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

Clear guides in Photoshop CS4 JS

Participant ,
Feb 04, 2010 Feb 04, 2010

Hi, I couldn't find anything in OMV or in the forum on how to remove existing guides in Photoshop. The help is highly appreciated.

Yulia.

TOPICS
Actions and scripting
3.4K
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
Guru ,
Feb 04, 2010 Feb 04, 2010

You have to use scriptlistner to clear the guides

function clearAllGuides() {
     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
Participant ,
Feb 04, 2010 Feb 04, 2010

Thank you, Michael, it works perfectly.

Yulia

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 ,
Sep 25, 2013 Sep 25, 2013

this doesn't work in photoshp cs6 64bit w7

please could you test it and maybe fix it?

thanks

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 ,
Sep 25, 2013 Sep 25, 2013

That Action Manager function does work in CS6. I don't know why it is not working for you unless you did not add the function call.

Here is a DOM version.

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 ,
Sep 25, 2013 Sep 25, 2013
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 ,
Sep 25, 2013 Sep 25, 2013
LATEST

The code in that thread to remove guides is the same as the code I posted. The only difference is I wrapped mine in a function. The function will not work unless called using

clearAllGuides();

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