• 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: Say "What?"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Say "What?"


  • Subject: Re: Say "What?"
  • From: Paul Skinner <email@hidden>
  • Date: Sun, 03 Jan 2010 11:56:45 -0500

So, the moral of this script is that Aliases aren't what I thought they were. I thought that they were references to the inode or some such, and didn't care about the file properties like names. Other than namespace collisions at the folders level that is. The solution seems to be to recreate the aliases as you modify the filenames. I had no idea that this was so. Has it always been so? 10.5.8 AS 2.0.1.

set testFolder to "Mac HD:Users:paul:Desktop:testFolder"
tell application "Finder"
delete every file of folder testFolder
set file1 to (make new file at testFolder with properties {name:"file1"}) as alias
set file2 to (make new file at testFolder with properties {name:"file2"}) as alias
set names to {name of file1, name of file2}
-->{"file1", "file2"}
set the name of file1 to "tempName"
set file1 to (file1 as text) as alias
set names to {name of file1, name of file2}
--{"tempName", "file2"}
set the name of file2 to "file1"
set file2 to (file2 as text) as alias
set names to {name of file1, name of file2}
-->{"file1", "file1"}
set the name of file1 to "file2"
set names to {name of file1, name of file2}
set file1 to (file1 as text) as alias
-->{"tempName", "file2"}
say "Oh."
end tell



On Jan 3, 2010, at 11:39 AM, Paul Skinner wrote:

set testFolder to "Mac HD:Users:paul:Desktop:testFolder"
tell application "Finder"
delete every file of folder testFolder
set file1 to (make new file at testFolder with properties {name:"file1"}) as alias
set file2 to (make new file at testFolder with properties {name:"file2"}) as alias
set names to {name of file1, name of file2}
-->{"file1", "file2"}
set the name of file1 to "tempName"
set names to {name of file1, name of file2}
--{"tempName", "file2"}
set the name of file2 to "file1"
set names to {name of file1, name of file2}
-->{"file1", "file1"}
set the name of file1 to "file2"
set names to {name of file1, name of file2}
-->{"tempName", "file2"}
say "What?"
end tell




_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Say "What?"
      • From: Christopher Nebel <email@hidden>
    • Re: Say "What?"
      • From: Axel Luttgens <email@hidden>
    • Re: Say "What?"
      • From: Paul Skinner <email@hidden>
References: 
 >Say "What?" (From: Paul Skinner <email@hidden>)

  • Prev by Date: Say "What?"
  • Next by Date: Re: Say "What?"
  • Previous by thread: Say "What?"
  • Next by thread: Re: Say "What?"
  • Index(es):
    • Date
    • Thread