foodfightr Posted August 29, 2008 Share Posted August 29, 2008 So I've tried writing a bash script (.sh) to configure my OS X preferences and every time I run it, it says "permission denied." #!/bin/bash # Disable shadow in screen window captures # http://www.macosxhints.com/article.php?story=20080629181121863 defaults write com.apple.screencapture disable-shadow -bool true # Change default screenshot format from PNG to JPG # http://www.macosxhints.com/article.php?story=20050627224051361 defaults write com.apple.screencapture type jpg # Show Bonjour in screen sharing application # http://www.macworld.com/article/131094/2007/12/screensharepower.html defaults write com.apple.ScreenSharing ShowBonjourBrowser_Debug 1 # Additional functionality in screen sharing application # http://www.macworld.com/article/131094/2007/12/screensharepower.html defaults write com.apple.ScreenSharing \ 'NSToolbar Configuration ControlToolbar' -dict-add 'TB Item Identifiers' \ '(Scale,Control,Share,Curtain,Capture,FullScreen,GetClipboard,SendClipboard,Qu lity)' my-mac:desktop Joe$ ./personalize.sh -bash: ./personalize.sh: Permission denied my-mac:desktop Joe$ sudo -s bash-3.2# personalize.sh bash: personalize.sh: command not found bash-3.2# ./personalize.sh bash: ./personalize.sh: Permission denied Link to comment Share on other sites More sharing options...
Adrian Fogge Posted August 29, 2008 Share Posted August 29, 2008 You need to do a "chmod 755 <filename>" to make the command executable. ~Adrian Link to comment Share on other sites More sharing options...
kitkat54 Posted August 29, 2008 Share Posted August 29, 2008 or run it like this: bash-3.2# /bin/bash script.sh Link to comment Share on other sites More sharing options...
hoyanf Posted August 30, 2008 Share Posted August 30, 2008 So I've tried writing a bash script (.sh) to configure my OS X preferences and every time I run it, it says "permission denied." #!/bin/bash # Disable shadow in screen window captures # http://www.macosxhints.com/article.php?story=20080629181121863 defaults write com.apple.screencapture disable-shadow -bool true # Change default screenshot format from PNG to JPG # http://www.macosxhints.com/article.php?story=20050627224051361 defaults write com.apple.screencapture type jpg # Show Bonjour in screen sharing application # http://www.macworld.com/article/131094/2007/12/screensharepower.html defaults write com.apple.ScreenSharing ShowBonjourBrowser_Debug 1 # Additional functionality in screen sharing application # http://www.macworld.com/article/131094/2007/12/screensharepower.html defaults write com.apple.ScreenSharing \ 'NSToolbar Configuration ControlToolbar' -dict-add 'TB Item Identifiers' \ '(Scale,Control,Share,Curtain,Capture,FullScreen,GetClipboard,SendClipboard,Qu lity)' my-mac:desktop Joe$ ./personalize.sh -bash: ./personalize.sh: Permission denied my-mac:desktop Joe$ sudo -s bash-3.2# personalize.sh bash: personalize.sh: command not found bash-3.2# ./personalize.sh bash: ./personalize.sh: Permission denied You can do this in AppleScript with Script Editor :- do shell script "defaults write com.apple.screencapture disable-shadow -bool true" with administrator privileges Link to comment Share on other sites More sharing options...
ifrit05 Posted August 30, 2008 Share Posted August 30, 2008 spotlight>search for script editor>write: do shell script "defaults write com.apple.screencapture disable-shadow -bool true" with administrator privileges do shell script"defaults write com.apple.screencapture type jpg" with administrator privileges do shell script "defaults write com.apple.ScreenSharing ShowBonjourBrowser_Debug 1" with administrator privileges save as whatever you want. Make sure you save it as an application though. dont know how to do the last one. sorry! Link to comment Share on other sites More sharing options...
Recommended Posts