Scripting dotMac slideshow subscriptions
Scripting dotMac slideshow subscriptions
- Subject: Scripting dotMac slideshow subscriptions
- From: Gnarlodious <email@hidden>
- Date: Wed, 22 Feb 2006 09:26:44 -0700
- Thread-topic: Scripting dotMac slideshow subscriptions
Title: Scripting dotMac slideshow subscriptions
Trying to get away from the arcane shell scripting and stick to Applescript. I need some help scripting the records and writing the changes to the file. Some of the recent breakthroughs with scripting preference files have been impressive.
set byHost to (path to preferences folder as Unicode text) & "ByHost"
tell application "Finder" to set prefFile to (folder byHost's files whose name contains "iToolsSlideSubscriptions")
set prefFile to (prefFile as Unicode text)'s POSIX path
tell application "System Events"
tell property list file prefFile
tell property list item "Subscriptions"
set allSubscriptions to property list items
set subscription1 to properties of item 1 of allSubscriptions
end tell
end tell
end tell
allSubscriptions is a list of records of all dotMac public slideshow subscriptions. Most of you will see only subscription1 , the default “.Mac” slideshow. The Prefpane offers no way to remove unwanted subscriptions, you can only disable them (in some cases they contain offensive pictures). This script is intended to delete unwanted subscriptions from the plist file. Some nice subscriptions are:
andybannister
bluegus
evikne
filtoc
gillum
jack_connick
kruubman
lsippu
ricmyra
The cache is located at
"Library:Caches:com.apple.iToolsSlideSubscriptions:"
Here is what the plist file looks like:
<key>Subscriptions</key>
<array>
<dict>
<key>ConfigURL</key>
<string>http://homepage.mac.com/NetSlides/.Pictures/Slide Shows/Public/config.plist</string>
<key>Selected</key>
<false/>
<key>ShowName</key>
<string>Public Slide Show</string>
<key>UserName</key>
<string>.Mac</string>
</dict>
<dict>
<key>ConfigURL</key>
etc...
subscription1 --> {kind:record, name:missing value, class:property list item, value:{|ConfigURL|:"http://homepage.mac.com/NetSlides/.Pictures/Slide Shows/Public/config.plist", |ShowName|:"Public Slide Show", |Selected|:false, |UserName|:".Mac"}}
What I want to do is collect a list of all UserName’s and offer the user a list of all items to delete. The script would then remove the <dict>...</dict> entry from the plist file and save the result. It would also delete the cache folder.
Anyone up for getting this going? I don’t know enough about records and plist files.
-- Gnarlie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden