Last active
October 24, 2017 14:24
-
-
Save davebrny/21b9f8147c82e66c913226ec6a8bc229 to your computer and use it in GitHub Desktop.
🎧 (autohotkey) - search operator hotstrings for spotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if winActive("ahk_exe Spotify.exe") | |
or winActive("Spotify ahk_exe chrome.exe") | |
or winActive("Spotify ahk_exe firefox.exe") | |
:*:a;:: ; album | |
:*:ar;:: ; artist | |
:*:t;:: ; track | |
:*:g;:: ; genre | |
:*:y;:: ; year | |
:*:l;:: ; label | |
:*:u;:: ; user | |
stringTrimLeft, operator, a_thisLabel, 3 | |
for what, with in { "a;":"album:" | |
, "ar;":"artist:" | |
, "t;":"track:" | |
, "g;":"genre:" | |
, "y;":"year:" | |
, "l;":"label:" | |
, "u;":"spotify:user:" } | |
stringReplace, operator, operator, % what, % with, all | |
if operator contains year:,user: | |
send % operator "{space}{left}" | |
else send % operator """""{space}{left 2}" | |
return | |
:*:y1;:: ; select 1st year | |
:*:y2;:: ; select 2nd | |
last_year := a_year | |
envSub, last_year, 1 | |
send % "year:" last_year "-" a_year | |
if a_thisLabel contains y1 | |
send {left 5} | |
send +{left 4} | |
return | |
:*:and;:: ; convert booleans to upper case | |
:*:or;:: | |
:*:not;:: | |
stringUpper, spotify_boolean, % regExReplace(a_thisLabel, "[\W]") | |
send % spotify_boolean . a_space | |
return | |
:*:new;::send tag:new ; new albums | |
#if ; end of spotify windows active | |
/* | |
[script info] | |
version = 1.5 | |
description = search operator hotstrings for spotify | |
author = davebrny | |
source = https://gist.github.com/davebrny/21b9f8147c82e66c913226ec6a8bc229 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spotify search operators