• 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: Brian Christmas <email@hidden>
  • Date: Thu, 23 Oct 2008 11:04:36 +1100


On 23/10/2008, at 9:41 AM, email@hidden wrote:

Hi I am trying to rename some files with applescript

I have two variables, oldName and newName

this is part of a bigger script, but have simplified it down to just what
is not working... the variables are normally created by the script, I have
substituted the info directly here to make it more clear...


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

any ideas as to what I am doing wrong?
thanks,
-Rich


G'day Rich

try

set oldName to "Users:richsimpson:Desktop:apc.jpg"
set newName to "test.jpg"
tell application "Finder"
  activate
  set name of file oldName to newName
end tell


Regards

Santa
_______________________________________________
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: renaming files with applescript
      • From: "Mark J. Reed" <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: Re: renaming files with applescript
  • Index(es):
    • Date
    • Thread