Tuesday, December 10, 2019

#1 2019-12-04 02:52:52 pm

barbarapress
Member
Registered: 2005-05-04
Posts: 270

Change this line so that it effects ALL open docs in InDESIGN

Hello,

I have this script that deletes all unused colors from the swatches panel in InDesign.


Applescript:


tell application "Adobe InDesign CC 2018"
   tell active document
       delete unused swatches
   end tell
end tell

I am trying to find the line that would address ALL OPEN DOCUMENTS, not just the active one.

Does anyone know if it is possible to have a script talk to all open documents?

thank you!
Babs

Browser: Safari 537.36
Operating System: macOS 10.14


Filed under: Indesign, All OPEN DOCS

Offline

 

#2 2019-12-04 03:47:50 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 705

Re: Change this line so that it effects ALL open docs in InDESIGN

Hi ya

this works fine for ID 2020, not sure about 2018.


Applescript:

tell application "Adobe InDesign 2020"
   repeat with i in every document
       set active document to i
       tell front document
           set UnusedSwatches to unused swatches
           repeat with UnusedSwatch from 1 to count of UnusedSwatches
               try
                   delete UnusedSwatches
               end try
           end repeat
       end tell
   end repeat
end tell


Cheers
Budgie

“Everything’s impossible until somebody does it.” – Batman

Offline

 

#3 2019-12-04 04:02:31 pm

barbarapress
Member
Registered: 2005-05-04
Posts: 270

Re: Change this line so that it effects ALL open docs in InDESIGN

Hi Budgie,

It worked perfectly in 2018 after changing to that app.

Thank you so much!

Trying to clean up files and this will help.

Greatly appreciated!

Babs smile

Offline

 

#4 2019-12-06 02:36:52 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11627
Website

Re: Change this line so that it effects ALL open docs in InDESIGN

Offtopic but instead of referring to the application names of the Adobe CC Suite which change frequently I recommend to use the bundle identifiers which don't change

Replace

Applescript:

tell application "Adobe InDesign 2020"

with

Applescript:

tell application id "com.adobe.InDesign"


regards

Stefan

Offline

 

#5 2019-12-06 06:33:40 pm

barbarapress
Member
Registered: 2005-05-04
Posts: 270

Re: Change this line so that it effects ALL open docs in InDESIGN

Hi Stefan,

Long time!

Thank you for this tip.

Just jumping back into this stuff and that is very helpful.  :-)

Thank you!!
Babs

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)