Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how can i clean all guides in photoshop?

Enthusiast ,
Apr 17, 2013 Apr 17, 2013

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

TOPICS
Actions and scripting
5.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Apr 17, 2013 Apr 17, 2013

Does View > Clear Guides record Action Manager code with ScriptingListener.plugin?

I can’t verify if that was already in CS4 (edited) CS3, though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 17, 2013 Apr 17, 2013
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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Apr 17, 2013 Apr 17, 2013

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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Apr 17, 2013 Apr 17, 2013

// 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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 17, 2013 Apr 17, 2013

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 );

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2013 Apr 17, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Apr 18, 2013 Apr 18, 2013

Could be, I passed that off as a typo in the post.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2013 Apr 18, 2013
LATEST

I forgot. English keyboard layout


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines