Been a lurker for a bit & finally decided to register. Ran into a problem and I couldn’t think of any other better place to ask
So, a few days ago, I found a bunch of Terminal commands for hidden QuickTime X preferences
http://forums.macrumors.com/showthread.php?t=775514
I then made scripts for those commands:
http://web.me.com/celebi23/QuickTimeXScripts/Main.html
I’m now trying to make a script for the amount of “Recent Items” shown.
http://i23.photobucket.com/albums/b355/eisnerguy1/RecentItems_1.png
I did get this to work but, then I think I accidentally did something & now it won’t work. The terminal commands work fine on there own as does the “Restore Defaults” part of the code. For some reason, the script is not saving the preference change:
set recentItems to {"1", "5", "10", "15", "20", "30", "50"}
display dialog (choose from list recentItems with prompt "Select the amount of Recent Items to display.")
if recentItems is "1" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 1"
else if recentItems is "5" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 5"
else if recentItems is "10" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 10"
else if recentItems is "15" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 15"
else if recentItems is "20" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 20"
else if recentItems is "30" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 30"
else if recentItems is "50" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit -integer 50"
end if
set buttonClicked to button returned of (display dialog "Please restart QuickTime Player for the preference changes to take effect." & return buttons {"Restore defaults", "Restart QuickTime Player"} default button 2 with icon alias ((path to me) & "Contents:Resources:QuickTimePlayerX_128.icns" as text))
if buttonClicked is "Restore defaults" then
do shell script "defaults delete com.apple.QuickTimePlayerX NSRecentDocumentsLimit"
tell application "QuickTime Player" to quit
delay 3 -- give the app time to quit, otherwise the next command may fail
tell application "QuickTime Player" to activate
else if buttonClicked is "Restart QuickTime Player" then
tell application "QuickTime Player" to quit
delay 3 -- give the app time to quit, otherwise the next command may fail
tell application "QuickTime Player" to activate
end if
Any help would be greatly appreciated.