• 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: ScriptEditorFormatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ScriptEditorFormatting


  • Subject: Re: ScriptEditorFormatting
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 08 Sep 2011 15:38:20 +0200

Here is the old script which I use :

--(SCRIPT keep_clean_prefs.app]
(*
To keep clean preferences files.
In your userAccount's Preferences folder,
create a subfolder named "safe_Prefs"

Store in this folder clean duplicates of the preferences files subject to corruption.
Save this script as an Application Bundle where you want.
Why not in your Applications folder?

Open the System Preferences Pane "Account"
Click on the "Login" tab.
Drag and drop the script's icon onto the window to add it to the list of login items.
On every boot process, the script will be run so it will install the clean prefs.
Of course, if you change something to the prefs and know that the file is clean,
duplicate the new version to the safe_prefs folder.

Yvan KOENIG (26 mai 2008)
*)
on run
run mon_script
end run

script mon_script
set p2prefs to path to preferences from user domain
set p2Safe to (p2prefs as Unicode text) & "safe_Prefs:"
if p2Safe does not end with ":" then set p2Safe to p2Safe & ":"
tell application "Finder"
if exists folder p2Safe then
set liste to items of folder p2Safe
repeat with p in liste
if class of p is folder then
set liste2 to items of p
if liste2 is not {} then
set p2prefs2 to ((p2prefs as text) & name of p & ":") as alias
repeat with p2 in liste2
duplicate (p2 as alias) to p2prefs2 with replacing
end repeat
end if
else
try
duplicate (p as alias) to p2prefs with replacing
end try
end if
end repeat
end if -- exists folder…
end tell
end script
--[/SCRIPT]

I guess that it would be a good idea to drop the Finder use.
When I wrote it, I didn't use Do Shell Script and there was no enabled Duplicate function in System Events.
Happily, thanks to the run script tip, it behave quickly as is.

Yvan KOENIG (VALLAURIS, France) jeudi 8 septembre 2011 15:38:15


 _______________________________________________
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: 
 >Re: ScriptEditorFormatting (From: wayne melrose <email@hidden>)

  • Prev by Date: Re: ScriptEditorFormatting
  • Next by Date: Re: Problem with Alarm Clock app
  • Previous by thread: Re: ScriptEditorFormatting
  • Next by thread: Re: Problem with Alarm Clock app
  • Index(es):
    • Date
    • Thread