Highlighted

HELP! Script or Macro to add Safety Marks on large multi-file doc

Community Beginner ,
Aug 18, 2020

Copy link to clipboard

Copied

Hi, I have a 780 page document that consists of 110 InDesign files. The file was set up by someone else to European standards and the copy is too close to the edge of the page for our printer to be able to hold the current safety zone and has asked for more space. So, I need to go in and move all the copy and other vital elements at laeast 3/16" from the Trim Area, and then adjust all the elements to be inside the Safety Area.

 

Is there a way to have these Safety Marks set up in some script or macro process? Having those marks would make all the other adjustment work I need to do much easier. Thanks!

Adobe Community Professional
Correct answer by rob day | Adobe Community Professional

Try this AppleScript

 

set safezone to 0.375
tell application id "com.adobe.indesign"	
	tell active document
		set docviewprefs to properties of view preferences
		set properties of view preferences to {ruler origin:spread origin, vertical measurement units:inches, horizontal measurement units:inches}
		set zero point to {0.0, 0.0}
		set p to every page
		repeat with x in p
			tell x
				set {a, b, c, d} to bounds
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:a + safezone}
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:c - safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:b + safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:d - safezone}
			end tell
		end repeat
		set properties of view preferences to docviewprefs
	end tell
end tell
TOPICS
How to, Scripting, Type

Views

146

Likes

Translate

Translate

Report

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

HELP! Script or Macro to add Safety Marks on large multi-file doc

Community Beginner ,
Aug 18, 2020

Copy link to clipboard

Copied

Hi, I have a 780 page document that consists of 110 InDesign files. The file was set up by someone else to European standards and the copy is too close to the edge of the page for our printer to be able to hold the current safety zone and has asked for more space. So, I need to go in and move all the copy and other vital elements at laeast 3/16" from the Trim Area, and then adjust all the elements to be inside the Safety Area.

 

Is there a way to have these Safety Marks set up in some script or macro process? Having those marks would make all the other adjustment work I need to do much easier. Thanks!

Adobe Community Professional
Correct answer by rob day | Adobe Community Professional

Try this AppleScript

 

set safezone to 0.375
tell application id "com.adobe.indesign"	
	tell active document
		set docviewprefs to properties of view preferences
		set properties of view preferences to {ruler origin:spread origin, vertical measurement units:inches, horizontal measurement units:inches}
		set zero point to {0.0, 0.0}
		set p to every page
		repeat with x in p
			tell x
				set {a, b, c, d} to bounds
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:a + safezone}
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:c - safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:b + safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:d - safezone}
			end tell
		end repeat
		set properties of view preferences to docviewprefs
	end tell
end tell
TOPICS
How to, Scripting, Type

Views

147

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 18, 2020 0
Adobe Community Professional ,
Aug 18, 2020

Copy link to clipboard

Copied

Do the pages have Masters? If they do make a layer on top and add page guides to the masters.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 1
Adobe Community Professional ,
Aug 18, 2020

Copy link to clipboard

Copied

I missed the 110 InDesign files part. Are the 110 files part of a Book file?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 1
Community Beginner ,
Aug 18, 2020

Copy link to clipboard

Copied

Hi Rob, thanks for your reply. Yes, they do have masters, and the 110 files are part of a Book File. I'm loooking for some way to set this up once and replicate it in some autonomous fashion rather than do it 780 or even 110 times. Thanks!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 0
Adobe Community Professional ,
Aug 18, 2020

Copy link to clipboard

Copied

You can take a look at Quick Resize: http://www.id-extras.com/products/quickresize/

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 0
Community Beginner ,
Aug 19, 2020

Copy link to clipboard

Copied

Thanks Brian, Unfortunately we need to keep the overall document the same size so this won't work. We just need to adjust the bleed and safeties on every page of all files in the book (then go in and manually adjust all the elements). I'm just looking for an easy way to set up the safety guides on 780 pages across 110 docs. I appreciate the suggestion though.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2020 0
Adobe Community Professional ,
Aug 19, 2020

Copy link to clipboard

Copied

What OS are you using?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2020 1
Community Beginner ,
Aug 19, 2020

Copy link to clipboard

Copied

Mac Catalina 10.15.6

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2020 0
Adobe Community Professional ,
Aug 20, 2020

Copy link to clipboard

Copied

Try this AppleScript

 

set safezone to 0.375
tell application id "com.adobe.indesign"	
	tell active document
		set docviewprefs to properties of view preferences
		set properties of view preferences to {ruler origin:spread origin, vertical measurement units:inches, horizontal measurement units:inches}
		set zero point to {0.0, 0.0}
		set p to every page
		repeat with x in p
			tell x
				set {a, b, c, d} to bounds
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:a + safezone}
				make new guide with properties {orientation:horizontal, guide type:ruler, fit to page:true, location:c - safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:b + safezone}
				make new guide with properties {orientation:vertical, guide type:ruler, fit to page:true, location:d - safezone}
			end tell
		end repeat
		set properties of view preferences to docviewprefs
	end tell
end tell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
Community Beginner ,
Aug 23, 2020

Copy link to clipboard

Copied

Thanks Rob. I'll give it a shot and let you know how it goes. I appreciate you taking the time to write the script for me.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 23, 2020 0
Community Beginner ,
Aug 24, 2020

Copy link to clipboard

Copied

Hi Rob, that didn't seem to work. It didn't add any visual guides for me. (Using InDesign CC 14.0.1) I'm going to see if I can play around with it a bit, but I'm still open to other suggestions. Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 24, 2020 0
Adobe Community Professional ,
Aug 24, 2020

Copy link to clipboard

Copied

Do you get an error, or are the simply guides not added? Are you running the script from AppleScript Editor, or are you compiling it in Script file format, and running it from your Scripts folder?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 24, 2020 0
Community Beginner ,
Aug 26, 2020

Copy link to clipboard

Copied

Hi Rob, I have InDesign CC open, one of the InDesign files open, and am running the script from the Script Editor. I'm not very familar with how to manage scripts, so if I'm doing something wrong I appreacaite the feedback/direction. Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

Copy link to clipboard

Copied

The script is adding page guides, are you sure you don’t have guides hidden—View>Grids & Guides>Show Guides? And your View>Screen Mode is set to Normal?

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

Copy link to clipboard

Copied

Screen Shot 38.png

 

This is what I get with guides showing in Normal mode when I Run

 

 

 

 

 

 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Community Beginner ,
Aug 26, 2020

Copy link to clipboard

Copied

Thanks Rob. Perhaps I'm doing something wrong... I'm not getting that. In fact, it seems like nothing happens on my end.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

Copy link to clipboard

Copied

Can you share a sample file via your CC account or Dropbox?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

Copy link to clipboard

Copied

Here’s a compiled version. You could try copying it into your Scripts folder and see if that works. I’m not using Catalina so it might be a script editor problem that I’m not aware of.

 

https://shared-assets.adobe.com/link/df3a2514-9d28-43d4-7816-e6052b4795e6

 

Copy the script file here:

 

/Applications/Adobe InDesign 2020/Scripts/Scripts Panel

 

and it should show in your ID Scripts panel. Double click to run.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Community Beginner ,
Aug 27, 2020

Copy link to clipboard

Copied

Thanks Rob.

I followed your directions above and it didn't seem to work for me. Here's a link to the file on Dropbox. Does it work for you? https://www.dropbox.com/s/u8uslcej4heoui0/0101_Energieketten.indd?dl=0

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
Adobe Community Professional ,
Aug 27, 2020

Copy link to clipboard

Copied

It worked for me.

 

I notice your file is saved with the View>Screen Mode set to Preview, and page guides don’t show in Preview mode. Also there are a lot of page items and the guides get added on the bottom layer. The script could create a top layer for the guides with the color set to black.

 

Here I’ve hidden your layers with the bottom layer showing so it is easier to see the scripted guides:

 

Screen Shot 42.png

 

 

 

 

 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
Adobe Community Professional ,
Aug 27, 2020

Copy link to clipboard

Copied

Here’s your doc saved with the added guides and the updated compiled script which puts the guides on their own layer:

 

https://shared-assets.adobe.com/link/b5a5760d-ccc2-4c26-59a1-99b21da54669

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
Community Beginner ,
Aug 27, 2020

Copy link to clipboard

Copied

Thank you so much Rob! I really appreciate your help. Having the guides on a top layer is definitely helpful, as I just want to adjust elements to be inside those guides.

 

Quick couple of questions. Does this script add the guides to every doc that's open in InDeisgn? Or only the doc that I'm in? Or only the page I'm on? And is it additng to masters or pages?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 0
rob day LATEST
Adobe Community Professional ,
Aug 27, 2020

Copy link to clipboard

Copied

Its adding 4 guides to each page of the active document. The master pages are not included

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 27, 2020 1