Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Indesign Dialog user interface - help with script

Guest
Jan 11, 2010 Jan 11, 2010

Hi , I am very new to apple script and found this web site forum here , maybe I can get help:)

I am trying to write a script in apple script to pop up a dialog that would as user where to save that file he/she is working on

here is my example non working script

tell document 1

set myName to name

set myFirstColumnWidth to 150

set myDialog to make dialog with properties {name:"Print"}

tell myDialog

tell (make dialog column)

--First Panel Border start

tell (make border panel)

tell (make dialog column)

--Options for a text size

set myTextSizeList to {"Folder1", "Folder2", "Folder3"}

tell (make dialog row)

tell (make dialog column)

make static text with properties {static label:"Book Title:", min width:myFirstColumnWidth}

end tell

tell (make dialog column)

set myTextSizeDropdown to make dropdown with properties {string list:myTextSizeList, selected index:5, min width:200}

end tell

end tell

end tell

end tell

end tell

end tell

set myResult to show myDialog

if myResult is true then

if selected index of myTextSizeDropdown is 0 then

save to "Server:Server Space:PDF1:" & myName

else if selected index of myTextSizeDropdown is 1 then

save to "Server:Server Space:PDF2:" & myName

else if selected index of myTextSizeDropdown is 2 then

save to "Server:Server Space:PDF3" & myName


end if

end if

end tell

end tell

also any possibility to do save a copy in applescript ? that would be even better. Any help is very much appreciated.

thank you

Dawid

TOPICS
Scripting
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 11, 2010 Jan 11, 2010

Your problem is that you're trying to make the dialog at the document rather than application level. Try this:

tell application "Adobe InDesign CS4"

tell document 1

set myName to name

end tell

set myFirstColumnWidth to 150

set myDialog to make dialog with properties {name:"Print"}

tell myDialog

tell (make dialog column)

--First Panel Border start

tell (make border panel)

tell (make dialog column)

--Options for a text size

set myTextSizeList to {"Folder1", "Folder2", "Folder3"}

tell (make dialog row)

tell (make dialog column)

make static text with properties {static label:"Book Title:", min width:myFirstColumnWidth}

end tell

tell (make dialog column)

set myTextSizeDropdown to make dropdown with properties {string list:myTextSizeList, selected index:5, min width:200}

end tell

end tell

end tell

end tell

end tell

end tell

set myResult to show myDialog

if myResult is true then

tell document 1

if selected index of myTextSizeDropdown is 0 then

save to "Server:Server Space:PDF1:" & myName

else if selected index of myTextSizeDropdown is 1 then

save to "Server:Server Space:PDF2:" & myName

else if selected index of myTextSizeDropdown is 2 then

save to "Server:Server Space:PDF3" & myName

end if

end tell

end if

destroy myDialog

end tell

You can't do a copy save directly; you'd need to do a save, close the document, and reopen the original.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 12, 2010 Jan 12, 2010

Yes that worked! Thank you very much.

since I can not use save copy with applescript, how would I write a script to save original in current location (it already has a name and location) then do the above script (save as)

close

and here is what I don't know: "open that original again" ?

thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 12, 2010 Jan 12, 2010
LATEST

Roughly:

set fullPath to full name of document 1

save document 1 to fullPath

-- do your save as here

close document 1 saving no

open fullPath

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