applescript
~/bin/somafm #!/bin/sh play() { osascript -e 'tell app "iTunes" to open location "'${1}'"' echo "play [ ${2} ]" } case $1 in stop) osascript -e 'tell app "iTunes" to stop' echo 'iTunes stop.' ;; help) echo "Usage: $0 {|help|stop|jazz|goa}"â¦
Safari osascript -e 'tell app "Safari"' -e 'activate' -e 'do JavaScript "window.location.reload();" in first document' -e 'end tell' Firefox System Eventsã使ãã®ã§ããã·ã¹ãã ç°å¢è¨å® -> ã¦ããã¼ãµã«ã¢ã¯ã»ã¹ãã®ãè£å©è£ ç½®ã«ã¢ã¯ã»ã¹ã§ããâ¦
set lastApp to (path to frontmost application as string) -- ãªããã®å¦ç tell application lastApp to activate
ãããããããã©ã«ãã«'.wdgt'ãã¤ãã¦ãdashboardã«ã¤ã³ã¹ãã¼ã«ããã ãã£ã¤ã on open theList set thePath to POSIX path of (item 1 of theList as string) set theSrc to thePath set tmp to AppleScript's text item delimiters set AppleScript's â¦
applescript tell application "iTunes" current stream title -- the name of the current song in the playing stream name of current track -- the URL of the playing stream or streaming web site end tell shell script #!/bin/sh # osascript -e 'tâ¦
property thePlaylist : "IndiePopRocks" tell application "iTunes" launch stop set the_playlist to user playlist thePlaylist set view of front window to the_playlist play the_playlist end tell ãã®ã·ã§ã«ã¹ã¯ãªããç #!/bin/sh PLAY_LIST='Indiâ¦
applescript.vim - Syntax highlighting for AppleScript : vim online
a.scpt on run argv return "hello, " & item 1 of argv & "." end runå®è¡ % osascript a.scpt world hello, world.
set theConfFile to "~/.synergy_home.conf" try set thePid to do shell script ("/bin/ps -x|grep synergys| grep -v grep|perl -ne '/^\\s*(\\d+)\\s+/;print $1;'") do shell script ("/bin/kill " & thePid) on error end try try -- ä¼ç¤¾ã¯æç· set isâ¦
splhack: vim7.1.100 property CR : ASCII character of 13 property ESC : ASCII character of 27 on open theList set thePath to POSIX path of (item 1 of theList as string) --display dialog thePath tell application "Vim" to activate tell applicâ¦
Firefoxãèµ·åãã¦ãªãæã« tell application "Firefox"ããã¨Parallelså ã®Firefoxãèµ·åãããã¨ããã®ã§ã if ( isRunFs() ) then tell application "Firefox" -- å¦ç end tell else display dialog { "try again." } -- ã¤ã¥ãã¦å¦çããããã¨ãã㨠-â¦
~/.pearrcãå·®ãæ¿ãã /usr/local/phpã«symlinkãå¼µãç´ãã apacheãåèµ·åããã property PEAR_RC : "/path/to/.pearrc" property PHP_DIR : "/path/to/php" property PHP_CURRENT : PHP_DIR --& "current" property PHP : PHP_CURRENT & "/bin/php" proâ¦
property SMB : "smb://WORKGROUP;user:pass@COMPUTER_NAME/path/to/dir" tell application "Finder" mount volume SMB activate -- ãªãã¨ãªã end tell
ãã¡ãé ãã¡ãç°å¢ä¾åï¼æ¥é ãcmd+spaceã使ç¨ãã¦ã人åãï¼ ãã詳ããã¯ã defaults -currentHost read com.apple.HIToolbox AppleCurrentInputSourceãã¦"Input Mode"ã§ç¨®å¥ãå¤æããã applescriptç property ROMAN : "smRoman" set IM to do shelâ¦
php-doc.vimã®ä¸éå端ãªãã¯ãª phpdoc ãæ¿å ¥ãã¦ãããã¹ã¯ãªãã - ååé² property TYPE_MIXED : "mixed" property TYPE_BOOL : "bool" property TYPE_ARRAY : "array" property TYPE_STR : "string" on run tell application "mi" tell document 1 set â¦
property PHP5 : "path/to/php5" property PHP4 : "path/to/php4" property PHP_DIR : "/usr/local/php/" property PHP_CURRENT : PHP_DIR & "current" property PHP : PHP_CURRENT & "/bin/php" property USER : "oppara" property PASS : "pass" property â¦
MTASC http://www.mtasc.org/#download ã¤ã³ã¹ãã¼ã« $ unzip ~/download/mtasc-1.12-osx.zip $ sudo mv ~/download/mtasc-1.12-osx /usr/local/. $ sudo ln -s /usr/local/mtasc-1.12-osx /usr/local/mtasc $ vi ~/.bashrc $ source ~/.bashrc $ mtasc -h mâ¦
åãã°OKç§å ´ ?ã¯ããã¯ã¹ã©ãã·ã¥ set theConfFile to "~/.synergy_home.conf" set theOfficeIp to "xxx.xxx.xxx.xxx" try set theCmd to "ps -x|grep synergys|grep -v grep|" set theCmd to theCmd & "perl -ne '/^??s*(??d+)??s+/;print $1;'" set thePiâ¦
getCwd(path to me) on getCwd(thePathToMe) set thePath to POSIX path of ((thePathToMe) as string) as string set theCwd to do shell script "perl -e '?"" & thePath & "?"=~ m@^(.+/).+/?@;print $1;'" return theCwd as string end getCwd
俺ã ã«ã¼ã« POSIXãã¹ã®æååã§åãæ±ãã ãã£ã¬ã¯ããªã¯"/"ã§çµããã "/hoge/moge/" -- ãã£ã¬ã¯ã㪠"hoge/moge" -- ãã¡ã¤ã« ããã±ã¼ã¸åããããã¡ã¤ã«ãfileãã¹ã«å¤æããã¨ãã£ã¬ã¯ããªæ±ãã«ãªãï¼ãããã¾ãï¼ "/hoge/moge.app" as POSIX file â¦
on writePropAndSaveAppBundle(theProp, theSrcPath, theDestPath) if isExistsItem(theDestPath) = false then do shell script "touch " & theDestPath end if tell application "Script Editor" activate open theSrcPath as POSIX file if theProp is noâ¦
on getPosixStr(theItem) if class of theItem is string then if theItem contains ":" then return (POSIX path of theItem) as string else return theItem end if else if class of theItem is Unicode text then return theItem as string else return â¦
詳ããã¯ãman osacompile $ osacompile -o ä¿åãããã¡ã¤ã«ã®ãã¹ èªã¿è¾¼ããã¡ã¤ã«ã®ãã¹ä¿åãããã¡ã¤ã«ã*.appã«ããã¨ã¢ããªã±ã¼ã·ã§ã³ãã³ãã«ã§ä¿åãããã ï¼ScriptEditorã§ä¿åããã®ã¨Info.plistãã¡ãã£ã¨éãï¼ èªã¿è¾¼ããã¡ã¤ã«ã¯ã*.scptã§â¦
on open theList set thePath to POSIX path of (item 1 of theList as string) display dialog thePath end open `
-- okãã¿ã³ã®ã¿ on dispOk(theMessage) display dialog (theMessage) buttons {"OK"} default button "OK" giving up after 20 end dispOk -- cancelãã¿ã³ã®ã¿ on dispError(theMes) display dialog theMes buttons {"Cancel"} default button 1 end dispEâ¦
on getFileList(thePosixPath, theExtension) set theList to {} set theFilePath to thePosixPath as POSIX file set theFileList to list folder theFilePath repeat with curItem in theFileList if curItem contains theExtension then set end of theLiâ¦
ãã®ã¾ãã¾ããã£ã...orz tell application "Finder" exists åç § ende tell on isExistItem(thePosixPath) try set theFilePath to thePosixPath as POSIX file set theAliasPath to theFilePath as alias return true on error return false end try end â¦