Skip to content

Instantly share code, notes, and snippets.

@deepsweet
Created December 6, 2017 10:56
Show Gist options
  • Save deepsweet/877f30481091b9e1f68210b9d3fc408d to your computer and use it in GitHub Desktop.
Save deepsweet/877f30481091b9e1f68210b9d3fc408d to your computer and use it in GitHub Desktop.
Open fullscreen album cover of current track in iTunes
  1. Save as ~/Library/iTunes/Scripts/show cover.scpt
  2. Run it from iTunes menu → weird unicode symbol I couldn't find → show cover
  3. Fail and get error message
  4. Allow iTunes to "control your computer" in macOS System Preferences → Security & Privacy → Privacy → Accessibility
  5. Try again
tell application "iTunes" to tell artwork 1 of current track
set srcBytes to raw data
if format is «class PNG » then
set ext to ".png"
else if format is JPEG picture then
set ext to ".jpg"
end if
end tell
set fileName to (((path to temporary items from user domain) as text) & "cover" & ext)
--display dialog fileName
open for access file the fileName with write permission
write srcBytes to file the fileName starting at eof
close access file the fileName
tell application "Finder"
open fileName
tell application "System Events" to tell process "Preview"
repeat until window 1 exists
end repeat
set value of attribute "AXFullScreen" of window 1 to true
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment