Airdrop für alle
26/09/2011defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1; killall FinderArchive of articles classified as' "terminal"
Back homedefaults write com.apple.NetworkBrowser BrowseAllInterfaces 1; killall Finderdefaults 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
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -sosxdaily hat auch noch diese Zeile hier zum Besten gegeben, um einen einfacheren Aufruf zu gewährleisten: sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport Danach kennt das Terminal ein airport-Kommando =)chflags nohidden ~/Librarymkdir pngs; sips -s format png *.* --out pngs Einfach in einem Verzeichnis mit z.B. eine Menge PSD-Dateien ausführen und man bekommt recht schnell eine PNG-Version dieser Dateien.ipkg update ipkg install inadyn Dann noch eine Konfigurationsdatei erstellen: vi /root/inadyn.conf mit dem Inhalt update_period_sec 1200 # Check for a new IP every 1200 seconds username hubionmac password 1skks9sjdj292 dyndns_system dyndns@dyndns.org alias blafasel.dyndns.orgund dann noch in in die /etc/rc.local eine den Aufruf für den Start einbauen: /opt/bin/inadyn --input_file /root/inadyn.conf & Neustart, fertig Ob das Funktioniert? Mal sehen =)optional kann man sich die Konfig-Datei auch sparen und den Aufruf direkt in die rc.local schreiben /opt/bin/inadyn --username blafaseuser --password blafasel --alias blafasel.dyndns.org --dyndns_system custom@dyndns.org --backgroundAls ich diesen Beitrag im Apple Forum gelesen hatte, erinnerte ich mich an sendEmail. Damit lassen sich über das Terminal Emails verschicken, ohne dass man zuerst mail oder gar sendmail konfigurieren muss. Es ist ein sehr praktisches Perl-Skript, mit dem man u.a. auch Anhänge versenden kann. Das Besondere ist aber eine recht neue Funktion, mit der man dem Programm den Email-Inhalt komplett übergeben kann, also auch den Email-Header. Auf diese weise lassen sich wunderbar gemixte HTML/TXT Emails (also Newsletter) verschicken.
Um zu verstehen wie so eine Multipart Email aussieht und warum überhaupt, empfiehlt es sich das hier zu lesen. Am Ende speichert man halt so etwas in der Art:
Ich hatte da eine Perl-Zeile die mir einen String "url-encoded", nur funktionierte dieser "do shell script"-Aufruf nicht in Filemaker (wissen die Götter wie die AppleScript dort ausführen). Auf jeden Fall waren das Filemaker zuviele Sonderzeichen in dem Befehl und es kam nur Murks dabei raus. Und weil ja so viele schöne Skript-Sprachen auf dem Mac schon vorinstalliert sind hier meine Top 3 Aufrufe fürs URL-Encoding unter AppleScript (Platz 1 funktioniert dann auch, wenn er in Filemaker ausgeführt wird):
Mir hat diese Sache aus dem AppleScript-Forum keine Ruhe gelassen auch wenn ein Plug-in für Safari da wohl etwas mehr her gemacht hätte. Zur Zeit ist aber leider nix anderes drin außer AppleScript. Es gibt 2 Versionen von dem Skript, eine als Skript-Datei, die man direkt aus Safari oder einem anderen Browser aus starten kann und eines das via Drag&Drop Dateien zu Pixelpipe hoch lädt. Die Script-Datei holt sich den Link zur einem Bild aus der Zwischenablage, lädt dieses herunter und pumpt es dann hoch auf PixelPipe. Das Programm lädt jede Bild-Datei hoch, die zuvor darauf gezogen wurde... Ich für meinen Teil werde Pixelpipe wohl kaum nutzen, aber in dem Quellcode sind so einige nützliche Sachen drin (URL-Escapeing, Curl-Form-Upload, Keychain-Scripting...)
Wenn man mal wissen möchte, wie lange die Batterie läuft und wie der Ladungsverlauf so aussieht, kann man sich mit pmset -g pslog >> ~/Desktop/pslog.txt ein Log schreiben lassen...