Friday, December 15, 2017

#1 2017-09-21 03:45:38 pm

Corbotron
Member
Registered: 2017-07-05
Posts: 16

InDesign hidden windows

Hi all,

I was hoping someone might be able to help me. I've written a script that involves opening multiple InDesign documents. It works fine as is, but I was hoping to improve it. I stumbled across a post on here that mentions opening an .indd without the window being visible. It claims that it speeds everything up. Plus, it would look a lot neater:

http://macscripter.net/viewtopic.php?id=23470

I've been searching around and I can't find a way to make this work. The code below (inddPageTemplate has been defined earlier in the script) doesn't seem to do the job:


Applescript:

tell application "Adobe InDesign CC 2017"
   set user interaction level of script preferences to never interact
   open inddPageTemplate without window
   tell active document

   ---body of script goes here
   
   save
   close
end tell
end tell

I'm aware that this forum post is 12 years old (!). Does anyone know if this is still possible? I'm using InDesign CC 2017 on Mac OS 12.10.6.

Thanks in advance.

Offline

 

#2 2017-09-22 10:58:47 am

kerflooey
Member
Registered: 2011-07-07
Posts: 138

Re: InDesign hidden windows

This works for me:

Applescript:



tell application "Adobe InDesign CC 2017"
   set user interaction level of script preferences to never interact
   set thisDoc to (open inddPageTemplate without window)
   tell thisDoc
       set contents of text frame "textflow1" of page 1 to "abc"
       
       ---body of script goes here
       
       save
       close
   end tell
   set user interaction level of script preferences to interact with all    
end tell

Offline

 

#3 2017-09-23 05:39:35 am

Corbotron
Member
Registered: 2017-07-05
Posts: 16

Re: InDesign hidden windows

Thanks kerflooey. That doesn't seem to work for me though. Perhaps we're running different versions of InDesign? The methods laid out in the Adobe InDesign Scripting Guide for CS6 don't work either.

However, I have managed to achieve what I wanted with the following:

Applescript:

set inddPageTemplate to ((path to desktop folder) & "PageTemplate.indd") as string as alias


tell application "Adobe InDesign CC 2017"
   set user interaction level of script preferences to never interact
   set thisDoc to open inddPageTemplate without showing window
   tell thisDoc
       set contents of (every text frame whose label is "testTextFrame") to "Test"
       save
       close
   end tell
   set user interaction level of script preferences to interact with all
end tell

As you can see, your addition of 'set thisDoc...' made the difference. Thanks very much.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)