Skip to content

Instantly share code, notes, and snippets.

@danreedy
Created December 13, 2011 17:23

Revisions

  1. danreedy revised this gist Dec 13, 2011. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions in_range.applescript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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
  2. danreedy created this gist Dec 13, 2011.
    2 changes: 2 additions & 0 deletions out_of_range.applescript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    tell application "Spotify" to pause
    tell application id "com.apple.ScreenSaver.Engine" to launch