How do I force open a file using a particular App?

G’day.

I’m trying to force open files, using an App that is not the default App. Trouble is, the usual scripting is not working; as an example, the following script still opens the file with extension ‘eps’ using the default ‘Illustrator’.

Any thoughts please?

TIA

Santa


set theApp to "GraphicConverter"

tell application "Finder"
	set temp to every item of desktop
	
	repeat with x in temp
		set y to x's name extension
		if y = "eps" then
			tell application theApp
				open x
			end tell
		        tell application "GraphicConverter"
				open x
			end tell
end if
	end repeat
end tell

BTW, I forgot the ‘activate’ command in the sample script, but it still doesn’t matter, even with it, GC won’t open the files.

Regards

Santa


set theApp to "GraphicConverter"

tell application "Finder"
	set temp to every item of desktop
	
	repeat with x in temp
		set y to x's name extension
		if y = "eps" then
			tell application theApp
				activate
				open x
			end tell
			tell application "GraphicConverter"
				activate
				open x
			end tell
		end if
	end repeat
end tell

Thanks Jacques, works brilliantly!

Santa