Article View: adobe.scripting.indesign
Article #1124"Place Cursor" Scripting Indesign CS3/CS4
From: Ryan_Nosek
Date: Tue, 17 Feb 2009 18:34
Date: Tue, 17 Feb 2009 18:34
54 lines
2135 bytes
2135 bytes
Hey Everyone:
I am trying to find a way to add images to the "Place Cursor via Applescript. Placing one item is no problem, however the "Place Cursor" should be activated in two instances:
1) You have more than one item selected and the script and the place command doesn't know where to put it
2) You have multiple images selected.
Is this scriptable? Here is what I have so far...
set fileList to {"Users:ryan:Desktop:Picture 18.png", "Users:ryan:Desktop:Picture 16.png"}
set totalFiles to (count every text item of fileList)
if totalFiles is equal to 1 then
set theFilePathAlias to (item i of fileList)
tell application "Adobe InDesign CS3"
set myDocument to active document
set myPage to page 1 of myDocument
set mySelection to selection
if (count mySelection) is equal to 1 then
tell myPage
set myPage to place theFilePathAlias on mySelection
end tell
else if (count mySelection) is greater than 1 then
--Send to Place Cursor
else if (count mySelection) is less than 1 then
tell myPage
set myPage to place theFilePathAlias
end tell
end if
end tell
else if totalFiles is greater than 1 then
tell application "Adobe InDesign CS3"
set myDocument to active document
repeat with i from 1 to totalFiles
set myPage to place theFilePathAlias
--Send to Place Cursor
end repeat
end tell
else
--Error no files selected
end if
Thanks
Technical Details
Message-ID:
<59b7f71c.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,d98e50e45d89878e,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Ryan_Nosek@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: "Place Cursor" Scripting Indesign CS3/CS4 Message-ID: <59b7f71c.-1@webcrossing.la2eafNXanI> Date: Tue, 17 Feb 2009 10:34:43 -0800 Lines: 58 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit