MACSCRPT Archives

April 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nigel Garvey <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sat, 4 Apr 2009 13:06:02 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
Bill Steele wrote on Fri, 3 Apr 2009 18:48:06 -0400:

>OK,. this works:
>
>set oneFolder to  "Bill'sHD:images:"
>set oneFile to "filename.jpg"
>set oneImage to oneFolder & oneFile as string
>tell application "GraphicConverter"
>       open alias oneIImage
>end tell
>
>But this doesn't:
>tell application "GraphicConverter"
>     open alias oneImage
>     set theInfo to get file imageinfo oneImage
>end tell
>-->"System error "File not found; Folder not found;(-[43)"
>
>Putting an alias in front of the imageinfo call also doesn't work.

Even the first one doesn't work for me. It seems that GraphicConverter
only accepts proper AppleScript file references (aliases or file
specifications) and that these have to be provided pre-formed. GC itself
can't itself resolve specifiers such as 'alias oneImage' or 'file
oneImage'. Coercions, though, seem to work inside the 'tell' block:

  tell application "GraphicConverter"
    open (oneImage as alias)
    set theInfo to get file imageinfo (oneImage as alias)
  end tell

I personally prefer to perform coercions once only:

  set oneFolder to  "Bill'sHD:images:"
  set oneFile to "filename.jpg"
  set oneImage to (oneFolder & oneFile) as alias -- or as file specification

  tell application "GraphicConverter"
    open oneImage
    set theInfo to get file imageinfo oneImage
  end tell


NG

ATOM RSS1 RSS2