Hi!
I’m woring on a script to convert PDFs to EPSs using Acrobat. The conversion-part works just fine.
My problems showes up when I’m trying to use dialog box-input to define the file name of my new EPS-file.
This works:
set theName to “test.eps” as text
This wont work:
display dialog “Type in the file-name here:” default answer “”
set theName to the text returned of the result as text
I just cant se why my script reacts differently to those two alternatives.
Here are the complete script:
Works:
on open thefile
tell application "Finder"
set theName to "test.eps" as text
set thePath to folder "Macintosh HD:Brukere:trond:Skrivebord:Inn farge:" as text
tell application "Adobe Acrobat 7.0 Professional"
activate
open thefile
save document 1 to (thePath & theName) using EPS Conversion
close document 1
end tell
end tell
end open
Wont work:
on open thefile
tell application "Finder"
display dialog "Type in the file-name here:" default answer ""
set theName to the text returned of the result as text
set thePath to folder "Macintosh HD:Brukere:trond:Skrivebord:Inn farge:" as text
tell application "Adobe Acrobat 7.0 Professional"
activate
open thefile
save document 1 to (thePath & theName) using EPS Conversion
close document 1
end tell
end tell
end open
Hmm…
Same result as before, but thanks for trying Waltr!
The strange thing is that when I tell my script to display a dialog with theName & thePath as text it shows exactly the same thing on both alternative scripts, but it wont work when the input comes from the user.
When the variable theName is defined in the script itself it works fine, but I want different names on my files (dooh…) so that wont work…