Re: renaming files with applescript
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