PDF to EPS --> Trouble using dialog box

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

Any suggestions?
Thanks in advance!

hi tto,

i can’t get your script to work properly on my machine because i don’t have Acrobat 7.0 Professional. however, i’d suggest trying something like:


set theName to text returned of (display dialog "Type in the file-name here:" default answer "")

hope that helps.

Hmm…
Same result as before, but thanks for trying Waltr! :slight_smile:

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…

Help?!? :o

hi tto,

what’s the error you are getting?

also, does the name from your input have any spaces?

“Document 1 of application “Adobe Acrobat 7.0 Professional” doesn’t understand the save message.”

The same result with or without spaces in the input name.

hi tto,

i got the same error trying to use 6.0 Standard. i thought it might just be my version.

one more suggestion, but i think this one is out of my league:

try using one more variable, like:


set myNewVar to (thePath & theFile)

and then try using myNewVar to save the file. i’m not sure why this might work, but it’s the only suggestion i’ve got left.

i’m not sure why AppleScript is treating your strings differently.

I was thinking the same tought earlier, but with the same error message.
Unfortunally…

Jacques!
I almost love you… :stuck_out_tongue:

Thanx alot!