Skip to content

Instantly share code, notes, and snippets.

@danreedy
Created December 13, 2011 17:23
Show Gist options
  • Save danreedy/1473013 to your computer and use it in GitHub Desktop.
Save danreedy/1473013 to your computer and use it in GitHub Desktop.
Out of Range Bluetooth Proximity Script
set t to ""
set t to do shell script "security 2>&1 find-generic-password -gl ScreenSaverPassword"
set KeyKind to "generic password"
set text item delimiters to "acct" -- Get Account name
set tlst to every text item of t
set acct to item 2 of tlst
set text item delimiters to "\""
set tlst to every text item of acct
set text item delimiters to "\"" -- Get Password
set tlst to every text item of t
set pw to item 2 of tlst
tell application "Spotify" to play
tell application "System Events" to keystroke return
delay 1
tell application "System Events" to keystroke pw
delay 1
tell application "System Events" to keystroke return
tell application "Spotify" to pause
tell application id "com.apple.ScreenSaver.Engine" to launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment