HI
this script below works but at the end when it prints
and brings up the dialog box the script does something else
and you have to click on the print window to bring it to the front before continueing. It did not do this before I added the if button = button returned part of the script.
Also is there another way to reference a piece of a script that is repeated instead of repeating as below.
any help would be appreciated.
Daniel
tell application “MultiAd Creator Pro”
if document 1 exists then
set theFolder to (folder of document 1) as text
set theName to name of document 1
end if
if text 1 thru 7 of theName is not equal to text 15 thru 21 of (theFolder) then
set wrong_name to button returned of ¬
(display dialog “This advert may be named Incorrectly” buttons {“Cancel”, “OK”} default button “Cancel” with icon stop)
if wrong_name = “OK” then
save document 1
set targetPath to “ADVERTS IN:”
set documentName to name of document 1
export EPS spread 1 of document 1 saving in (targetPath & documentName) font inclusion no fonts preview options color or gray export method composite scaling by 100.0 with binary encoding and level 2 PostScript without TIFF OPI Comments, OPI Omit TIFF and OPI Omit EPS
with timeout of 300 seconds
tell application "MultiAd Creator Pro"
print document 1 with interaction, text overflow checking and missing font checking
end tell
end timeout
end if
else
set folder_path to (theFolder)
tell application "Finder"
set names_ to (name of files of folder folder_path whose name begins with text 15 thru 21 of theFolder & "00" and name ends with ".HED") as list
end tell
set highest_ to item 1 of names_
repeat with i from 2 to (count names_)
if item i of names_ is greater than highest_ then
set highest_ to item i of names_
end if
end repeat
set f to text 8 thru 9 of highest_
tell application "MultiAd Creator Pro"
if text 8 thru 9 of theName is not equal to f then
set update_name to button returned of ¬
(display dialog "This advert may have been updated" buttons {"Cancel", "OK"} default button "OK" with icon stop)
if update_name = "OK" then
save document 1
set targetPath to "ADVERTS IN:"
set documentName to name of document 1
export EPS spread 1 of document 1 saving in (targetPath & documentName) font inclusion no fonts preview options color or gray export method composite scaling by 100.0 with binary encoding and level 2 PostScript without TIFF OPI Comments, OPI Omit TIFF and OPI Omit EPS
with timeout of 300 seconds
tell application "MultiAd Creator Pro"
print document 1 with interaction, text overflow checking and missing font checking
end tell
end timeout
end if
else
save document 1
set targetPath to "ADVERTS IN:"
set documentName to name of document 1
export EPS spread 1 of document 1 saving in (targetPath & documentName) font inclusion no fonts preview options color or gray export method composite scaling by 100.0 with binary encoding and level 2 PostScript without TIFF OPI Comments, OPI Omit TIFF and OPI Omit EPS
with timeout of 300 seconds
tell application "MultiAd Creator Pro"
print document 1 with interaction, text overflow checking and missing font checking
end tell
end timeout
end if
end tell
end if
end tell