Skip navigation
Currently Being Moderated

Delete all Guides in Document

Aug 17, 2012 6:35 AM

Does anyone happen to know how to delete all the guides in a document? I'm aware I can use Ctrl + Alt + G then press delete to delete the guides on a single page or spread, but what about in the entire opened document (every page at once)? I've researched it some and located the following script:

 

var myDoc = app.activeDocument;

if(myDoc.guides.length > 0){myDoc.guides.everyItem().remove();}

 

I'm sorry to say this script didn't work for me. This is the error message I received:

 

Error Number: 1025

Error String: Expected end of statement

Engine: Default

File: C:\Users\......etc.

Line: 1

Source: var myDoc = app.activeDocument;

 

If anyone knows a way around this or knows how to fix this script please let me know and anyone else who might be interested.

 
Replies
  • Currently Being Moderated
    Aug 17, 2012 7:01 AM   in reply to sperry1975

    var myDoc = app.activeDocument;

    if(myDoc.guides.length > 0){

        myDoc.guides.everyItem().remove();

    }

     

     

     

    Found the same one as you. Works for me in Mac CS5. Deletes all them guides including master pages. Just edit one of the exisitng javascripts and do a save as to a new name.jsx.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 7:05 AM   in reply to sperry1975

    You don't tell what version of InDesign you're using. Since Mike says it works in CS5, there's probably nothing wrong with the script.

     

    If you're using CS6, create a new folder in your User InDesign Scripts folder, name it "Version 5.0 Scripts" (without the quotes), and put the script inside that folder.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 8:47 AM   in reply to Tom Usrey

    Tom Usrey wrote:

     

    You don't tell what version of InDesign you're using. Since Mike says it works in CS5, there's probably nothing wrong with the script.

     

    If you're using CS6, create a new folder in your User InDesign Scripts folder, name it "Version 5.0 Scripts" (without the quotes), and put the script inside that folder.

    Version 5.0 Scripts would be the ones from CS3. CS5 is version 7.0.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 11:35 AM   in reply to Peter Spier

    Thanks for correcting that, Peter. Unfortunately my hands don't work as well as they used to.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 11:43 AM   in reply to Tom Usrey

    No problem.

     

    It might or might not even matter, depending on the script. Some scripts will run in multiple versions of ID without a problem, while others rely on specific parts of the scripting model which sometimes change from version to version. Using a subfolder in this way tells ID which version's scripting model to use in interpreting the script code. (this is for the OP and lurkers -- I'm sure Tom already knows this).

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points