Re: What the !? two script variants to move a file - one works, the other doesn't?
Re: What the !? two script variants to move a file - one works, the other doesn't?
- Subject: Re: What the !? two script variants to move a file - one works, the other doesn't?
- From: Andrew Oliver <email@hidden>
- Date: Sat, 22 Jan 2005 17:28:55 -0800
Title: Re: What the !? two script variants to move a file - one works, the other doesn't?
On 1/22/05 3:19 PM, "Bill Christens-Barry" <email@hidden> wrote:
I'm trying to write a script, under Mac OS 10.3.7, Script Editor 1.9.3, to
move a file ("File.tif") from a specified folder
("Volume:Folder:SubFolder1:") to a different folder whose name is taken from
a text file ("PointerFile.txt").
[snip]
This script does not work:
property mPath : "Volume:Folder:" as string
property theFile : "File.tif" as string
tell application "Finder"
set src to (mPath & "SubFolder1:" & theFile)
set aa to a reference to file src
set bb to mPath & "PointerFile.txt"
set dst to a reference to bb
open for access file dst
set theDst to read (dst)
close access dst
move aa to folder theDst
end tell
The second script generates an error:
AppleScript Error: Finder got an error: Can't make
"Volume:Folder:PointerFile.txt" into a file.
I’m guessing it fails because dst is a reference to a string, and nothing more.
Your original (working) script says:
set dst to a reference to file bb
vs.
set dst to a reference to bb
Therefore ‘read’ fails because you’re trying to read a string, not a file.
Andrew
:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden