• 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: renaming files with applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: renaming files with applescript


  • Subject: Re: renaming files with applescript
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 22 Oct 2008 16:01:47 -0700
  • Thread-topic: renaming files with applescript

On 10/22/08 3:41 PM, "email@hidden" wrote:

> Hi I am trying to rename some files with applescript
>
> this does not work:
> set oldName to "Users:richsimpson:Desktop:apc.jpg"
> set newName to "Users:richsimpson:Desktop:test.jpg"
> tell application "Finder"
>     activate
>     set name of file oldName to newName
> end tell
>
> this does not work either:
> tell application "Finder"
>     activate
>     set name of file "Users:richsimpson:Desktop:apc.jpg" to
> "Users:richsimpson:Desktop:test.jpg"
> end tell

The variable newName should contain only the name, not the full path. Also,
be sure to include the disk in the variable oldPath.

set oldPath to "Mac HD:Users:richsimpson:Desktop:apc.jpg"
set newName to "test.jpg"
tell application "Finder"
    set name of file oldPath to newName
end tell

Stan C.


 _______________________________________________
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

References: 
 >renaming files with applescript (From: email@hidden)

  • Prev by Date: Re: renaming files with applescript
  • Next by Date: Re: renaming files with applescript
  • Previous by thread: Re: renaming files with applescript
  • Next by thread: How to simulate C's function pointer in AppleScript?
  • Index(es):
    • Date
    • Thread