Copy link to clipboard
Copied
Hello,
i try to develop a plugin and the last issue i have to fix is to add a button witch can toggle the grid and the rulers.
i have tried it with the ScriptListerner but the Code Result always break.
have anybody a solution for that problem?
Target: PhotoShop CC 2018
Do you need this? )
app.runMenuItem(stringIDToTypeID("toggleGrid"))
app.runMenuItem(stringIDToTypeID("toggleRulers"))
Copy link to clipboard
Copied
Do you need this? )
app.runMenuItem(stringIDToTypeID("toggleGrid"))
app.runMenuItem(stringIDToTypeID("toggleRulers"))
Copy link to clipboard
Copied
yeah, i can not believe that it is so simple
thank you
is there a solution to get the status of the grid and rulers?
so that i just can activate the rulers when the grid is already set
Copy link to clipboard
Copied
For the rulers, use this code in CC2018
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "rulersVisibility" ) );
r.putEnumerated( charIDToTypeID( "Dcmn" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
var rulers_is_visible = executeActionGet(r).getBoolean(stringIDToTypeID("rulersVisibility"));
alert(rulers_is_visible)
For the grid so far, they have not done it yet, I think so ).
UPD.
You can use
app.runMenuItem(stringIDToTypeID("showAll"))
or
app.runMenuItem(stringIDToTypeID("showNone"))
Then toggle the necessary view.
In order to see the menu code in ScriptingListenerJS.log, use the "insert menu item" in the action palette menu when you record the action.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now