• 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: Changing the name of a file in the temporary items folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the name of a file in the temporary items folder


  • Subject: Re: Changing the name of a file in the temporary items folder
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 06 Dec 2007 20:36:29 -0800
  • Thread-topic: Changing the name of a file in the temporary items folder

Title: Re: Changing the name of a file in the temporary items folder
On 12/6/07 6:09 PM, "Michelle Steiner" <email@hidden> wrote:

When I run this script

set source to (choose file)
set destination to choose folder
tell application "Finder"
set temp to (duplicate source to path to temporary items from user domain)
set name of temp to "new name." & name extension of temp
name of temp
end tell


Why doesn't it change the name of the file?

Are you quite sure it doesn't? 'temp' is a Finder reference (file "oldname.ext" of of folder "TemporaryItems" of folder "Caches" of folder "Library" of folder "me" of folder "Users" of startup disk) , not an alias. So once you've renamed it, 'temp' - as a Finder reference - no longer exists. It should error, and does in OS 10.4.11

Try this:

set source to (choose file)
set destination to choose folder
tell
application "Finder"
    set temp to (duplicate source to path to temporary items from user domain) as alias
   set name of temp to "new name." & name extension of temp
   name of temp
end tell
--> "new name.doc"

--
Paul Berkowitz
 _______________________________________________
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: Changing the name of a file in the temporary items folder
      • From: Michelle Steiner <email@hidden>
References: 
 >Changing the name of a file in the temporary items folder (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Finder inconsistency (Was: What makes AppleScript difficult)
  • Next by Date: Re: Changing the name of a file in the temporary items folder
  • Previous by thread: Changing the name of a file in the temporary items folder
  • Next by thread: Re: Changing the name of a file in the temporary items folder
  • Index(es):
    • Date
    • Thread