Re: can't make document
Re: can't make document
- Subject: Re: can't make document
- From: Mr Tea <email@hidden>
- Date: Mon, 23 Feb 2004 22:24:03 +0000
On 23 Feb 2004, at 8.31 pm, Wesley Smith wrote:
Previously, I've set a variable as a file
reference, and I've verified that everything is in order, but when I
do say
"open for access (file reference)", I get the message "can't make
document
file FILENAME of folder FOLDER of disk DISK".
Is the 'file reference' a string containing the path to the file, an
alias, or a Finder item reference (file A of folder B of... etc). If
it's the second or third of these, there's no way on God's green earth
that you'll be able to use it directly with the 'open for access'
command.
In that event, you would need somthing like this:
set fileRef to "Disk:Folder:File"
open for access file fileRef...
If you need to convert a Finder item reference or alias to a string,
just use the "as string" coercion:
tell application "Finder"
set fileRef to file "File" of folder "Folder" of disk "Disk" as string
end tell
...or...
set fileRef to alias "Disk:Folder:File" as string
(Alternatively, you can 'force' the coercion by doing this sort of
thing:
set fileRef to "" & alias "Disk:Folder:File"
That's the 'hey, I know a thing or two about AppleScript' way to do it.)
HTH, and apologies if you knew all this already.
Nick
pp Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.