Question about Gridlines

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

wolo50

Question about Gridlines

Post by wolo50 »

I written simple JS to open a File and would like to turn on (make visible) the grid lines as part of the script. I have had no luck finding an example.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

larsen67

Question about Gridlines

Post by larsen67 »

From what I tried nothing gets recorded when using the scriptlistener plug-in with this view option?
Mike Hale

Question about Gridlines

Post by Mike Hale »

If you use 'Insert Menu Item' in the action panel you can record showing/hiding the guides. But it is a toggle so you will not know if you are turning them on or off.

But if that is better than nothing you could use xtools to convert the action into javascript.( or check xbytor's stdlib, he may have already done so )
wolo50

Question about Gridlines

Post by wolo50 »

Thanks Mike. I did what you suggested and it work. Here is the code:

//turn gridlines on/off
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(charIDToTypeID('Mn '), charIDToTypeID('MnIt'), charIDToTypeID('TgGr'));
desc1.putReference(charIDToTypeID('null'), ref1);
executeAction(charIDToTypeID('slct'), desc1, DialogModes.NO);

Thanks again