• 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: What the !? two script variants to move a file - one works, the other doesn't?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >What the !? two script variants to move a file - one works, the other doesn't? (From: Bill Christens-Barry <email@hidden>)

  • Prev by Date: Re: Styles in MS Word
  • Next by Date: Re: Content of message - Apple's Mail app
  • Previous by thread: What the !? two script variants to move a file - one works, the other doesn't?
  • Next by thread: Exiting a script ?
  • Index(es):
    • Date
    • Thread