• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script running the wrong application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Script running the wrong application
      • From: Chris Nebel <email@hidden>
  • Prev by Date: Re: Script running the wrong application
  • Next by Date: Re: Script running the wrong application
  • Previous by thread: Re: Script running the wrong application
  • Next by thread: Re: Script running the wrong application
  • Index(es):
    • Date
    • Thread