Archive of articles classified as' "defaults write"

Back home

Airdrop für alle

26/09/2011
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1; killall Finder
2 Comments

OS X Lion: Fensterwiederherstellung für einzelne Programme sperren

11/08/2011
defaults write com.apple.QuickTimePlayerX NSQuitAlwaysKeepsWindows -bool false via OS X Lion: Fensterwiederherstellung für einzelne Programme sperren « macnews.de.In der Library, unter Saved Application State werden alle Programme aufgeführt, bei denen ein solcher SavedState bereits gespeichert wurde =) also warum nicht ein kleines Skript:

--11.08.2011 little script to edit saved state settings for a single app instead of all apps

global myhome

tell application "Finder"

set myhome to POSIX path of (home as alias)

set theitems to name of every item of folder "Saved Application State" of folder "Library" of home

set theapps to {}

repeat with theitem in theitems

if (theitem as text) ends with ".savedState" then

set theapps to theapps & ((characters 1 through -12 of theitem as text) as text)

end if

end repeat

end tell

set theapp to (choose from list theapps with prompt "Which app with saved state?") as text

set theactions to {"Delete SavedState", "Disable SavedState", "Enable SavedState", "Freeze Saved State", "Defrost Saved State"}

set theaction to (choose from list theactions with prompt "Which action?") as text

if theaction = (item 1 of theactions) as text then

my deleteSavedState(theapp)

else if theaction as text = (item 2 of theactions) as text then

my disableSavedState(theapp)

else if theaction as text = (item 3 of theactions) as text then

my enableSavedState(theapp)

else if theaction as text = (item 4 of theactions) as text then

my freezeSavedState(theapp)

else if theaction as text = (item 5 of theactions) as text then

my defrostSavedState(theapp)

end if


on deleteSavedState(appName)

--moves avedState to user's trash folder and plays drag to trash sound

do shell script "mv " & myhome & "Library/'Saved Application State'/" & quoted form of appName & ".savedState ~/.Trash/;afplay /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/dock/drag\\ to\\ trash.aif"

end deleteSavedState


on disableSavedState(appName)

--uses defaults write to disable saved state for this particular app

do shell script "defaults write " & appName & " NSQuitAlwaysKeepsWindows -bool false"

do shell script "afplay /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/ink/InkSoundBecomeMouse.aif"

end disableSavedState

on enableSavedState(appName)

--uses defaults write to disable saved state for this particular app

do shell script "defaults write " & appName & " NSQuitAlwaysKeepsWindows -bool true"

do shell script "afplay /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/ink/InkSoundBecomeMouse.aif"

end enableSavedState


on freezeSavedState(appName)

--changes user permissions to read only, so that savedStated is frozen

do shell script "chmod u-w " & myhome & "Library/'Saved Application State'/" & quoted form of appName & ".savedState"

do shell script "afplay /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/ink/InkSoundBecomeMouse.aif"

end freezeSavedState

on defrostSavedState(appName)

--changes user permissions to read&write again, so that savedStated is not frozen any more

do shell script "chmod u+w " & myhome & "Library/'Saved Application State'/" & quoted form of appName & ".savedState"

do shell script "afplay /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/ink/InkSoundBecomeMouse.aif"

end defrostSavedState

Update:

Ok, das hier ist nun wirklich eine schönere Lösung: http://www.tuaw.com/2011/07/26/dear-aunt-tuaw-help-me-fine-tune-session-window-restores/
No Comments

Defaults write: diskutil für extra Optionen

21/08/2010
Für ein paar extra Features im Diskutil, sofern man damit etwas anzufangen weiß: defaults write com.apple.DiskUtility advanced-image-options 1
No Comments

und noch mehr defaults write

23/02/2010
http://secrets.blacktree.com/?show=all&page=1
und einer den ich noch nicht kannte bezüglich Spaces(To lower the delay between moving windows from space to space): defaults write com.apple.dock workspaces-edge-delay -float 0.1; killall Dock
No Comments

Apple Mail: Unter 10.6 Email-Adressen kopieren

23/10/2009
Seit 10.6 kopiert Apple Mail Email-Adressen immer zusammen mit dem Namen. Wählt man also "Adresse kopieren" in Apple Mail aus, bekommt man so etwas in die Zwischenablage kopiert hubionmac <klar_doch_meine_email_posten@hubionmac.com>
Will man aber nun wirklich nur die Email-Adresse kopieren, muss man eine entsprechende Einstellung über defaults write setzten

defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool NO
No Comments

super Anleitung zum deaktivieren der nervigen Top Sites in Safari

6/10/2009
von roderick.dk

So groß ist der Safari cache

Code zum markieren einmal anklicken
du -h ~/Library/Caches/com.apple.Safari/Webpage\ Previews

Das einfach löschen:

cd ~/Library/Caches/com.apple.Safari/Webpage\ Previews;rm *

und nun Safari diese Unart austreiben:

defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
tested with 10.6.1
No Comments

Unsichtbare Dateien im Finder zeigen

17/09/2009
Als kleines Tool:
Code zum markieren einmal anklicken oder Code im Skript-Editor öffnen

set h to button returned of (display dialog "Make Finder show all files" buttons {"Yes", "nope, default"} default button {"YES"}) as text

if h = "Yes" then

do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder"

else

do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder"

end if

No Comments

Zeitersparnis beim Dialogaufbau

19/06/2009
Damit klappen die Dialog etwas schneller auf... quasi sofort =)
defaults write NSGlobalDomain NSWindowResizeTime .001
No Comments

FrontRow per default auf einem anderen Bildschirm

11/12/2008
defaults write com.apple.frontrow FrontRowUsePreferredDisplayID <<displayID>> Die Display ID bekommt man soweit ich es bisher weiss recht schnell durch Ausprobieren der Display IDs aus (~/Library/Preferences/com.apple.preference.displays....plist) heraus. Bei sah es dann am Ende so aus: defaults write com.apple.frontrow FrontRowUsePreferredDisplayID 69673024 (danach nur noch FronRow neustarten)
No Comments

.DS_Store Dateien nicht mehr anlegen lassen

13/08/2008
Gerade in gemischten Netzwerken nervt es, wenn die Macs auf den Shares immer ihre "unsichtbaren" Dateien wie .DS_Store hinterlassen. Tinker Tool kann da u.a. Abhilfe schaffen, indem man das Anlegen solche Dateien über den Finder unterbindet.
2 Comments