Re: Script running the wrong application
Re: Script running the wrong application
- Subject: Re: Script running the wrong application
- From: Victor Yee <email@hidden>
- Date: Sat, 25 Aug 2001 11:30:36 -0400
On Fri, 24 Aug 2001 14:17:49 -0700, Michelle Steiner wrote,
>
I have a folder with JPEG files with a Picture Viewer creator. I have a
>
script that tells Graphic Converter to open the pictures, but Picture
>
Viewer winds up opening them. Anyone know why?
>
>
Here's the code:
>
>
set the folderToProcess to choose folder
>
tell application "Finder"
>
set the photoList to (the files of the folderToProcess)
>
end tell
>
repeat with photo in the photoList
>
tell application "GraphicConverter"
>
open the photo
>
end tell
>
end repeat
It seems to be related to the fact that photoList contains a list of Finder objects, so perhaps the Finder interpretation of "open" overrides the AS command.
The Finder dictionary says:
open reference -- list of objects to open
Whereas the ASGL (Commands:Open) says:
Syntax
open referenceToFile
Parameter
referenceToFile
A reference of the form file nameString or alias nameString, or a list of such references...
So perhaps if the parameter after "open" is an object, then the Finder command is used, but if the parameter is of the form file or alias, then the AS command is used.
Victor