Thursday, July 27, 2017

#1 2017-07-04 12:04:10 pm

Jeffkr
Member
Registered: 2005-11-05
Posts: 458

InDesign CC 2017 - Find Text Preferences Question

I am not sure how to tell InDesign CC to only apply its find text preference to only search upon the active document. For example, in my code below it is searching for matching text strings in all open documents. Does anybody know how to isolate the find to just the active document, front document, or document 1?

Thanks,
-Jeff

Applescript:

tell application "Adobe InDesign CC 2017"
   activate
   set theWord to "Hello World"
   tell application "Adobe InDesign CC 2017"
       set find what of find text preferences to theWord
       set include locked layers for find of find change text options to true
   end tell
   tell document 1
       set searchWordText to find text theWord
       set searchWordTextCount to count of searchWordText
   end tell
end tell

Offline

 

#2 2017-07-04 12:17:05 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3127

Re: InDesign CC 2017 - Find Text Preferences Question

What if you edit the code as :

Applescript:

set theWord to "Hello World"
   tell application "Adobe InDesign CC 2017"
   activate
--    tell application "Adobe InDesign CC 2017"
       set find what of find text preferences to theWord
       set include locked layers for find of find change text options to true
--    end tell
   tell document 1
       set searchWordText to find text theWord
       set searchWordTextCount to count of searchWordText
   end tell
end tell

Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) mardi 4 juillet 2017 19:16:42

Offline

 

#3 2017-07-04 12:41:13 pm

Jeffkr
Member
Registered: 2005-11-05
Posts: 458

Re: InDesign CC 2017 - Find Text Preferences Question

Hi Yvan,
Unfortunately your code is also returning the matching string for both open documents, instead of just the active document.

Thanks,
-Jeff

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)