Choose file not opening file

I’m writing a script in which the user selects a PDF, and a PitStop preflight is run on the PDF. Unfortunately, I’m doing something wrong. Here’s the code snippet:

if user_choice is "NL issue PDF" then tell application "Adobe Acrobat 7.0 Professional"
	activate
	choose file with prompt "Please select the locked issue PDF."
	delay 3
	tell application "System Events"
		tell process "Acrobat"
			-- GUI Scripting statements:
			
			click menu item "Execute Enfocus QuickRun: Check Security" of menu 1 of menu item "Enfocus QuickRuns" of menu 1 of menu item "Enfocus PitStop Professional" of menu 1 of menu bar item "Plug-Ins" of menu bar 1
		end tell
	end tell
end tell

The problem is this: it prompts the user to select a file, but doesn’t open it. If a file is already open in Acrobat, it will happily run the preflight on the open file. (The whole click menu item line selects the menu item for running the prelight.) I tried putting in a delay, thinking maybe it was running the preflight before the user-selected file had a chance to open, but it doesn’t seem to help.

Any ideas?

Thanks,
Don

AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

it may be silly, but it just worked for me. Try replacing your item of script with this

	set filechosen to choose file with prompt "Please select the locked issue PDF."
	open filechosen

choose file returns an alias (that you can use to reference the file later), it doesn’t open them. I don’t have Acrobat, but I would try opening the file. :wink:

if user_choice is "NL issue PDF" then tell application "Adobe Acrobat 7.0 Professional"
	activate
	choose file with prompt "Please select the locked issue PDF."
	open result
	-- the rest of your script
end tell

Yeah, that might help. Thanks, CS & Bruce for the assist. I appreciate it.

Don