Jump to content

Recommended Posts

Introduction
The Get App Icon purpose is to:

  • extract app’s icon from installed in /Application folder apps;
  • extract app’s icon from Alfred action extension
  • download app’s icon from App Store and Mac App Store

Download

  • from Packal → link
  • direct download → link

Screenshots
QLa4WD5m.png8MUWUrkm.pngJhJJfhJm.pngMuq658Jm.pngXbowu4gm.png 
 
How it works?
To invoke Get App Icon workflow:

  • use the icon keyword which will list all available in /Application folder apps; at top of results there is option to switch to online (App Store / Mac App Store) search that will search for typed app name;
  • use File Action Extract app icon on chosen app on your Mac.

The workflow behaves as follow:

  • when used with local application it converts app’s icon in .icns format into .png using the biggest icon size (which is usually 1024 × 1024 or 512 × 512 px) and save it into Desktop folder;
  • when used with online application it downloads its icon in .png format (please read Tips also for further information).

Tips
As you know, iPhone as well as iPad app icons have rounded corners. But the downloaded files will be squares until you meet this requirement: you have to have installed PIL library for Python. If you don’t have it, but want to, it is quite easy to install. First of all, you need to install pip — package installer for Python. Run below command in Terminal (required administrator password):

sudo easy_install pip 

Next, install Pillow library using pip:

pip install --user Pillow 

That's it. If you want to check if everything was installed properly run in Terminal command:

python

You will get into Python editor. Type in there:

import PIL 

If everything was made properly you shouldn’t get any message just get into new line.

Now you’re done! From now on the downloaded through Get App Icon workflow icons from App Store will have rounded corners! :)
 
Release info:1.5:

  • initial public release
Edited by Maciej Skrzypczak

Share this post


Link to post

Cool workflow!

 

FWIW, adding your Homebrew Python's site-packages to the system Python's site-packages isn't a particularly great thing to do in any case, and it won't always work in this case because the system Python on Snow Leopard is 2.6.

 

I think it might be a better idea to use pip install --user Pillow. It will be installed in a standard location for the right Python.

Share this post


Link to post

Cool workflow!

 

FWIW, adding your Homebrew Python's site-packages to the system Python's site-packages isn't a particularly great thing to do in any case, and it won't always work in this case because the system Python on Snow Leopard is 2.6.

 

I think it might be a better idea to use pip install --user Pillow. It will be installed in a standard location for the right Python.

 

 

Thanks for feedback!

 

I gave the Homebrew solution because as far as I can remember there were problems with pip not integrating Pillow with Python. But maybe this changed now. I will check and eventually update my first post.

Share this post


Link to post

HI Maciej,

 

Great workflow. If I’m not mistaken, icons are extracted from a european App Store ? Is there a way to make the workflow extract icons from the App Store in my country (Canada) ? 

Edited by Serge

Share this post


Link to post

HI Maciej,

 

Great workflow. If I’m not mistaken, icons are extracted from a european App Store ? Is there a way to make the workflow extract icons from the App Store in my country (Canada) ? 

 

Hi Serge, glad you like my workflow.

 

Sure you can extract icons from Canada App Store, altough it requires editing one of the workflow's files. In Alfred Preferences, go to Workflows tab, find my Get App Icon workflow and click it with right mouse button (or Ctrl+click). In the pop-up menu choose Show in Finder. The Finder window with workflow's files will open. Just edit with some text editor (like TextWrangler) the file acpython.py. Right at the top of the file you should find a lot of "#". Underneath is COUNTRY variable with value of 'pl'. Just change 'pl' to ISO code of country you want (for Canada that should be 'ca', for others see this Wikipedia site → link). Save the file. Now you should get results from your App Store.

Share this post


Link to post

I ran into this issue installing pip.

 

 

matt$ sudo easy_install pip

Password:

Searching for pip

Best match: pip 7.1.2

Processing pip-7.1.2-py2.7.egg

pip 7.1.2 is already the active version in easy-install.pth

Installing pip script to /usr/local/bin

error: [Errno 2] No such file or directory: '/usr/local/bin/pip'

 

Solution was to cd to /usr/local/bin and delete the three symlinks for pip (pip, pip2, pip2.7) that were there and getting in the way.

 

Then redo the command easy_install command.

 

BUT i still do not have rounded corners?

Edited by gingerbeardman

Share this post


Link to post

Installing this on my home machine, pip & Pillow installed without issue.

 

But still no rounded corners?

 

So, I did some debugging and it seems that often (always?) the icon is downloaded as a JPG.

 

The rounded corner operation works fine, but the image is saved back as a JPG.

 

quick fix in acpython.py

 

this:

output.save(qr)

becomes:

output.save(qr + '.png')

to create a copy of the icon as a png with rounded corners

Edited by gingerbeardman

Share this post


Link to post

Installing this on my home machine, pip & Pillow installed without issue.

 

But still no rounded corners?

 

So, I did some debugging and it seems that often (always?) the icon is downloaded as a JPG.

 

The rounded corner operation works fine, but the image is saved back as a JPG.

 

quick fix in acpython.py

 

this:

output.save(qr)

becomes:

output.save(qr + '.png')

to create a copy of the icon as a png with rounded corners

 

 

Thanks for fix gingerbeardman!

 

I've also updated direct download link in first post.

Share this post


Link to post

Thanks for fix gingerbeardman!

 

I've also updated direct download link in first post.

 

BTW, Packal still shows version 1.5.

 

I'm on Alfred 3, and for a minute there, I thought I was losing my mind or had forgotten how to use the workflow.  LOL

Share this post


Link to post
Posted (edited)

Has this workflow stopped working with Alfred 4? 🤔 Search App Icon online is not working for me. 

Thx

Edited by DJay

Share this post


Link to post

Does not work with online search for Alfred 4.0.

 

[18:05:28.890] Logging Started...
[18:05:30.309] Get App Icon [1.5][Script Filter] Queuing argument 'pastebin'
[18:05:30.412] Get App Icon [1.5][Script Filter] Script with argument '(null)' finished
[18:05:30.415] Get App Icon [1.5][Script Filter] <?xml version="1.0"?><items>
		<item>
			<arg>online^pastebin</arg>
			<title>Search app icons online</title>
			<subtitle>Switch to online search in App Store and Mac App Store</subtitle>
		</item>
<item>
			<arg></arg>
			<title></title>
			<icon type="fileicon"></icon>
		</item>
</items>
[18:05:34.789] Get App Icon [1.5][Script Filter] Processing complete
[18:05:34.797] Get App Icon [1.5][Script Filter] Passing output 'online^pastebin' to Run Script
[18:05:34.991] ERROR: Get App Icon [1.5][Run Script] 35:44: syntax error: A “"” can’t go after this identifier. (-2740)

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...