For quite some time Mac users where searching for a way to paste the currently playing song from iTunes in chat messages etc. I never thought about it much but recently a friend of mine, who was a former AMIP user on Windows, needed a similar functionality under OS X. Together we constructed a working solution.

So here it is the AMIP alternative for Mac:

    • Open Automator and start a new “Service”
    • Choose “no input” for “Service receives”
    • Drag the “Run AppleScript” Action into the workflow
    • Paste in the following and edit the output in (green) to your hearts desire
on run
 try
 tell application "iTunes"
 set songTitle to the name of the current track
 set songArtist to the artist of the current track
 set songAlbum to the album of the current track
 set songYear to the year of the current track
 set the clipboard to "np:" & the songArtist & " - " & songTitle & " \"" & songAlbum & ", " & songYear & "\""
 end tell
 end try
 try
 set the clipboard to Unicode text of (the clipboard as record)
 on error errMsg
 display dialog errMsg
 end try
 tell application "System Events"
 key code 9 using {command down}
 end tell
end run
  • Save the service. I named mine “music” (creative isn’t it? 🙂 )
  • Now your able to run the service from every application’s menu under “Services”. Be sure to have your cursor in a text field because the service will immediately paste in the constructed string.
  • If you’re in a super nerdy mood today, you can also give your service a keyboard shortcut.
    Go to “System Preferences”, open “Keyboard”, go to “Keyboard Shortcuts” and set your desired Hotkey. (mine’s CMD + SHIFT + M)

I’d be happy to see further improvements, thoughts & ideas about this solutions in the comments!

 

And to all my Austrian friends: Frohen Faschingsdienstag (not that I’d care!)

BSS app iconLast weekend I sat down and built a surveillance system, including an iPhone webapp, for my apartment using my old iBook, an external iSight, the Webcam Software EvoCam and a set of scripts in AppleScript, PHP and some shell scripts.

The whole thing is pretty custom made but I’ll document it here anyway and with a basic understanding of the technology it should be fairly easy to reproduce with whatever hardware you have available. At the end of the post you’ll find a ZIP file with all the scripts I used in the setup.

The set up

  • The iBook has the iSight connected and pointed at the entrance door.
  • iBook is using MAMP to serve PHP scripts and produces some audible confirmation messages.
  • The iPhone webapp shows if the system is armed or not, can start or stop EvoCam, lists all the available surveillance videos and offers a link to the live video stream.
BSS CTRL center

BSS CTRL center

Read on for the whole article with a detailed explanation of all components.
Continue reading