Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applescript to backup Suitcase prefs files, just not working right

Status
Not open for further replies.

ChokingMyTrap

Technical User
Oct 5, 2004
90
US
Hey,

Im trying to make an applescript to backup my Suitcase prefs, then another one to restore the prefs from the backup.

Just not working right and im not sure what im doing wrong. It creates my backup folder but hangs on copying the files to it.

--Applescript to backup--
try
do shell script "mkdir ~/Library/Preferences/Suitcase_Pref_Restore"
end try
try
do shell script "cp ~/Library/Preferences/Suitcase\\ Preferences/*.* ~/Library/Preferences/Suitcase_Pref_Restore"
end try

--End Backup Script


The other file will work when I know what im doing wrong here. I have a good idea it has to do with the \\, im used to just doing one \ for spaces, but applescript wont comple it like that.

What am I doing wrong :p

Cheers
 
Nevermind, just figured it out


try
do shell script "mkdir ~/Library/Preferences/Suitcase_Pref_Restore"
end try
try
do shell script "cp ~/Library/Preferences/'Suitcase Preferences'/* ~/Library/Preferences/Suitcase_Pref_Restore"
end try
 
That script was no good, wouldn’t copy forks. Discovered the ditto command, heres the final working version incase anyone else wants to do this. I find Suitcase is horrid at calfing out, and doing weird things once a lot of fonts are installed.

--Backup Prefs Script--

try
do shell script "mkdir ~/Library/Preferences/Suitcase_Pref_Restore"
end try
try
do shell script " ditto --rsrc ~/Library/Preferences/Suitcase\\ Preferences ~/Library/Preferences/Suitcase_Pref_Restore"
end try

--End Script--



--Rebuild Prefs Script--

try
do shell script " ditto --rsrc ~/Library/Preferences/Suitcase_Pref_Restore ~/Library/Preferences/Suitcase\\ Preferences"
end try

--End Script--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top