Re: Pathnames derived from variables
Re: Pathnames derived from variables
- Subject: Re: Pathnames derived from variables
- From: Michelle Steiner <email@hidden>
- Date: Mon, 11 Dec 2000 13:10:02 -0800
On 12/11/00 12:31 PM, Robert Seckendorf <email@hidden> wrote
>
Any words of wisdom about how to extract the value of "text returned" from a
>
dialog box and supply it to an application as the "filename" parameter in a
>
open command?? What I have so far doesn't work...
>
tell application "Finder"
>
set userInput to display dialog "What file do you want to open?" buttons
>
{"OK", "Cancel"} ,
>
default button "OK" default answer ""
>
set fileRef to a reference to text returned of userInput
>
tell application "Adobe. Photoshop. 5.5"
>
activate
>
open {fileRef} -- This doesn't seem to work
>
end tell
>
end tell
First of all, why use display dialog instead of choose file?
set fileRef to choose file with prompt ,
"What file do you want to open?" of type {"JPEG"}
--adjust file types to suit your needs
tell application "photoshop"
activate
open fileRef
end tell
Using display dialog as you did, the user will have to specify the full
pathname of the file (e.g., disk:folder:folder:file) and the open
statement has to be
open file fileRef
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------