Copy link to clipboard
Copied
Hi
i have photoshop cs6 on my desktop windows7
and cs3 on my laptop xp
is there a script to delete all the guides ?
thanks
Copy link to clipboard
Copied
Does View > Clear Guides record Action Manager code with ScriptingListener.plugin?
I can’t verify if that was already in CS4 (edited) CS3, though.
Copy link to clipboard
Copied
var id3 = charIDToTypeID( "Dlt " ); var desc2 = new ActionDescriptor(); var id4 = charIDToTypeID( "null" ); var ref1 = new ActionReference(); var id5 = charIDToTypeID( "Gd " ); var id6 = charIDToTypeID( "Ordn" ); var id7 = charIDToTypeID( "Al " ); ref1.putEnumerated( id5, id6, id7 ); desc2.putReference( id4, ref1 ); executeAction( id3, desc2, DialogModes.NO );
this code works!
Copy link to clipboard
Copied
That code is from the scriptlistener plug-in. So is the code I posted. The only difference between the two is I cleaned up the code in the log and wrapped it in a function. If one works for you, the other should unless you made a copy/paste or save error. Or didn't call the function. It will not run unless called. i.e.
removeGuides();
Copy link to clipboard
Copied
// for versions earlier than CS5, also work in newer versions
function removeGuides(){
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Gd " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Al " ) );
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
}
// CS5 or higher
app.activeDocument.guides.removeAll();
Copy link to clipboard
Copied
but it doesn't work
i create a file guides.jsx with this code only and i tried to rename to guide.jz ,it doesn't clear guides in cs3
// for versions earlier than CS5, also work in newer versions
function removeGuides(){
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Gd " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Al " ) );
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
}
Copy link to clipboard
Copied
Michael L Hale wrote:
That code is from the scriptlistener plug-in. So is the code I posted. The only difference between the two is I cleaned up the code in the log and wrapped it in a function. If one works for you, the other should unless you made a copy/paste or save error. Or didn't call the function. It will not run unless called. i.e.
removeGuides();
There is one more difference:
mantralightroom wrote:
… and i tried to rename to guide.jz ,it doesn't clear guides in cs3 …
That can not work.
Copy link to clipboard
Copied
Could be, I passed that off as a typo in the post.
Copy link to clipboard
Copied
I forgot. English keyboard layout
Find more inspiration, events, and resources on the new Adobe Community
Explore Now