My goals:
- See some info on what's currently playing (singer name, song name...) from (mostly) anywhere.
- Change the volume adjustment of the current song from (mostly) anywhere.
So I created some AppleScripts and Services using Automator and assigned keyboard shortcuts to them.
The solutions:
- Create a pop-up notification when keyboard shortcut is pressed.
- AppleScript:
to openInfo(name, num, artist, album, played, volume)display notification "" & artist & " (" & album & ")" subtitle "" & num & ": " & name & "(vol " & volume & ")"
end openInfotell application "iTunes"set sel to current track
my openInfo(name of sel, track number of sel, artist of sel, album of sel, track count of sel, volume adjustment of sel)
end tell - Service receives "no input" in "any application", run AppleScript:
on run {input, parameters}set sAlias to "/Users/fcarasso/Apps/ShowCurrentItunesTrack.scpt"
run script sAlias
end run - My shortcut: command-F13
- Toggle volume adjustment then show current and previous adjustment as a pop-up notification when keyboard shortcut is pressed.
- AppleScript:
tell application "iTunes"set toggles to {-50, -25, 0, 100, -50}
set adj to volume adjustment of current track
set newAdj to "not done"
repeat with i from 1 to count toggles
set low to toggles's item i
set high to toggles's item (i + 1)
if adj is low or (adj ≥ low and adj < high) then
set (volume adjustment of current track) to (toggles's item (i + 1))
set newAdj to volume adjustment of current track
exit repeat
end if
end repeat
display notification "New volume adjustement: " & newAdj & " (from " & adj & ")"
end tell - Service receives "no input" in "any application", run AppleScript:
on run {input, parameters}set scAlias to "/Users/fcarasso/Apps/ToggleVolumeAdjustment.scpt"
run script scAlias
return input
end run - My shortcut: command-F14

No comments:
Post a Comment