Note that there are some explanatory texts on larger screens.

plurals
  1. POResize Image with AppleScript
    text
    copied!<p>I've encountered a little problem when I wanted to modify a ApplScript, that I am using to get my current iTunes Coverinto a image file that I display on my Desktop via GeekTool. Now I wanted also to resize this Image because some Images are a bit small...</p> <p>I found some solutions online, but none of them worked... And since I am not that much into AppleScript I also can't handle it myself.</p> <p>This is my current Code:</p> <pre><code>set the_artwork_file to ((path to home folder) as string) &amp; "Music:iTunes:CurrentArtwork.png" tell application "System Events" if ("iTunes" is in name of processes) then tell application "iTunes" if (player state is not stopped) and (player state is not paused) and (artworks of current track exists) then set theArt to front artwork of current track set pic to (raw data of theArt) try set RefNum to (open for access the_artwork_file with write permission) write (pic) to RefNum close access RefNum return end try end if end tell end if end tell do shell script "rm -f " &amp; (POSIX path of the_artwork_file) </code></pre> <p>Ok, nevermind, I managed to solve it finally. The Code I generated was basically correct, but I had to put it into an separate Script-File. In GeekTool I have to call them directly after each other and it works just fine!</p> <p>This is the Code I used now:</p> <pre><code>tell application "Image Events" set this_image to open ((path to home folder) as string) &amp; "Music:iTunes:CurrentArtwork.png" scale this_image to size 1080 save this_image in ((path to home folder) as string) &amp; "Music:iTunes:CurrentArtwork.png" close this_image end tell </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload