Macworld Forums: AppleScript Help!!! - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

AppleScript Help!!!

#1 User is offline   chinqie Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 17-March 05

Posted 17 March 2005 - 02:03 AM

So I used Script Editor to make an AppleScript to make a copy of my iTunes 4 Music Library data file (you know how devastating it can be when the file is corrupted and you lose all your playlists and ratings and stuff like that). Thing is, I don't know what's wrong with it...

tell application "Finder"
duplicate "~/Music/iTunes/iTunes 4 Music Library"
["~/Documents"]
end tell
0

#2 User is offline   car1son Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,349
  • Joined: 30-August 01

Posted 17 March 2005 - 07:54 AM

I use (excerpt)
code:
tell application "Finder"
set dateSuffix to (do shell script "/bin/date +%Y-%m-%d")
set BuDiskName to "FirebaseOne"
set BuFolderName to ("Small BackUp " & dateSuffix)
set diskName to "Macintosh HD"
set bcFolder to folder "bc" of folder "Users" of disk diskName
-- Make new folder for today's Mini Backup
make new folder at folder "Mini Backups" of disk BuDiskName with properties {name:BuFolderName}
-- iTunes library
duplicate file "iTunes 4 Music Library" of folder "iTunes" of folder "Music" of bcFolder to folder BuFolderName of disk BuDiskName
duplicate file "iTunes Music Library.xml" of folder "iTunes" of folder "Music" of bcFolder to folder BuFolderName of disk BuDiskName
end tell

Addendum:
(That above may be more complex than you want, since it makes a separate backup folder for each day.) Probably a simpler case from my Powerbook's import script:
code:
tell application "Finder"
duplicate file "iTunes 4 Music Library" of folder "iTunes" of folder "Music" of disk "remoteHome" to folder "iTunes" of folder "Music" of folder "car1son" of folder "Users" of disk "Exile" with replacing
end tell

The "with replacing" addition to the duplicate command lets it replace the existing copy with the new one.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users