|
|
10.5: Add a 'recent things' stack to the Dock
I made this handy (and simple) AppleScript to make adding Recent Items stacks to the dock easier. It displays a dialog that asks if you want a Recent Items stack, which you can accept or reject, then executes the proper terminal command and kills the dock. It even gives you the option of which side you'd like it on. Enjoy.
set dialogText to "Would you like to add a Recent Items icon to your Dock?"
set appSideScript to "defaults write com.apple.dock persistent-apps -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }';killall Dock"
set docSideScript to "defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }';killall Dock"
display dialog dialogText buttons {"No Thanks", "Yes! Left Side, Please!", "Yes! Right Side, Please!"} default button 1
if button returned of result is "Yes! Left Side, Please!" then
do shell script appSideScript
else
if button returned of result is "Yes! Right Side, Please!" then
do shell script docSideScript
end if
end ifEdited on Feb 03, '10 09:13:56PM by robg
10.5: Add a 'recent things' stack to the Dock
You have too many quotes – you put a string inside a string which really doesn't work.
10.5: Add a 'recent things' stack to the Dock
New to all of this scripting.. when compling this code I'll get an error msg..
Script update
Here's a neater version that works:
global abutton
set cbutton to "Cancel" -- cancel button
set abutton to "Applications Section" -- app side button
set dbutton to "Documents Section" -- docs side button
display dialog "Add a Recent Items stack to the Dock?
This will temporarily disable both the Dock and Dashboard" buttons {cbutton, abutton, dbutton} default button 3
set rbutton to the button returned of the result
if rbutton ≠cbutton then addStack(rbutton)
on addStack(button)
if button = abutton then
set side to "apps"
else
set side to "others"
end if
do shell script ("defaults write com.apple.dock persistent-" & side & " -array-add '{ \"tile-data\" = { \"list-type\" = 1; }; \"tile-type\" = \"recents-tile\"; }';killall Dock")
end addStackEdited on Feb 03, '10 09:13:35PM by robg
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|