: How can I extract cursor coordinate in Adobe Photoshop for use in Action script? What I want to do in Photoshop (version CC, but I think this applies to any version) is label a point using
What I want to do in Photoshop (version CC, but I think this applies to any version) is label a point using count tool under my mouse's current position, and label it multiple times (for different labels). I have an macro action that essentially does this:
(1) Add to count (under one label)
(2) Switch to second label
(3) Add to count (under second label)
(4) Switch to third label
(5) Add to count (under third label)
And the problem is that I need to be able to have a variable in the action script that uses the cursor's current position (X and Y numbers) on the canvas to set these three points when the macro is activated. Currently I am only able to record the script using constant X, Y values (the same point is labeled over and over when I play the recorded action). I am able to extract the code for the action for editing (via xbytor2's suggestion in this forum: forums.adobe.com/thread/696989) and I see where the variable can go, I just don't know what exactly to put in place of the constant X, Y values that will let Photoshop input the mouse's current coordinates...
Any ideas? Much appreciated!!
More posts by @Speyer780
1 Comments
Sorted by latest first Latest Oldest Best
There may not be an easy solution to your problem. However, using the ScriptingListener plugin may help. It produces javascript like this:
var list4 = new ActionList();
var desc33 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc33.putUnitDouble( idHrzn, idPxl, 148);
var idVrtc = charIDToTypeID( "Vrtc" );
var idPxl = charIDToTypeID( "#Pxl" );
desc33.putUnitDouble( idVrtc, idPxl, 358 );
var idPnt = charIDToTypeID( "Pnt " );
list4.putObject( idPnt, desc33 );
As you can see, this is pretty much akin to you action xml so it might help. Although, it's a few years old, here's the link to installing and using it from Adobe's site: ScriptingListener plug-in
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.