• 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
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]

What the !? two script variants to move a file - one works, the other doesn't?


  • Subject: What the !? two script variants to move a file - one works, the other doesn't?
  • From: Bill Christens-Barry <email@hidden>
  • Date: Sat, 22 Jan 2005 18:19:07 -0500

Title: What the !? two script variants to move a file - one w
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").

This script works:

     property theFile : "File.tif" as string

        tell application "Finder"
               set mPath to "Volume:Folder:" as string
                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 file bb
               open for access dst
             set theDst to read (dst)
                close access dst
                move aa to folder theDst
        end tell



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.
The only difference between the two scripts is in how a value is assigned to the variable "mPath". Can anyone help me understand why the second script isn't working?

Thanks.

Bill Christens-Barry
--
-----------------------
Bill Christens-Barry, PhD
Equipoise Imaging, LLC
email@hidden
410-750-6656
 _______________________________________________
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

  • Follow-Ups:
    • Re: What the !? two script variants to move a file - one works, the other doesn't?
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Do shell script question - non sudoer user
  • Next by Date: Re: Styles in MS Word
  • Previous by thread: Re: Do shell script question - non sudoer user
  • Next by thread: Re: What the !? two script variants to move a file - one works, the other doesn't?
  • Index(es):
    • Date
    • Thread