Jump to content

Recommended Posts

Introduction

Have you ever needed that specific app icon to use in your review? Get App Icon workflow comes to help! Open up Alfred, type 'icon' and app's name. If it one installed in your macOS, you should find it in the list. Press Enter and the icon will await on your Desktop.

What if that's the app for iPhone or iPad (or just app from Mac App Store)? Just use the 'online' option to search and download.

Download

  • from Packal → link
  • direct download → link

Screenshots
http://i.imgur.com/QLa4WD5m.pnghttp://i.imgur.com/8MUWUrkm.pnghttp://i.imgur.com/JhJJfhJm.pnghttp://i.imgur.com/Muq658Jm.pnghttp://i.imgur.com/Xbowu4gm.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).

Requirements

  • installed Python version 3
  • installed Pillow library for Python 3

 
Changelist:

2.2:

  • added workflow's description
  • country code and limit are set as Environment Variables, so there is no need to edit files, just change them in Workflow Environment Variables window
  • bug fixes

2.1:

  • bug fixes

2.0:

  • action rewritten to use Python3

1.5:

  • initial public release
Edited by mcskrzypczak
Updated to version 2.2
Link to comment

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.

Link to comment

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.

Link to comment
  • 6 months later...

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
Link to comment

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.

Link to comment
  • 1 month later...

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
Link to comment
  • 2 weeks later...

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
Link to comment
  • 3 months later...

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.

Link to comment
  • 3 months later...
  • 2 years later...

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)

 

Link to comment
  • 4 months later...

To fix this, you can add this after line11 of file acshell.sh

LIST+=$(find /System/Applications -maxdepth 2 | egrep -i "\.app$" | grep -i "$QUERY")

Then it works for most of system apps.

 

But Catalyst Apps, like Podcast.app,  still doesn't work. As their internal structures(Info.plist and icns files) are different from the AppKit apps.

I don't know how to fix this.

Link to comment
  • 2 months later...

Hi all, 

 

I just downloaded from packal (old 1.5) -> does not work on Catalina 

 

Then I tried the direct download link (should be 1.6?) -> 404 

 

The "old" workflow that did work pre Catalina does not work any more in Catalina. 

I'm using Alfred v 4. 

 

Can someone add a working copy who is running it on Catalina and Alfred v 4? 

 

Best regards,

Jan  

Link to comment
21 minutes ago, mcskrzypczak said:

And once again the workflow got updated to version 2.2 (see the first post for download and changelist)

Thanks for your work. 

But the Workflow is not working 100% for me.

I can save icons from installed Apps. They are saved on the desktop.

I can search for icons in App store (set to de). Results are showing up and the notification is showing "Icon extraction successful". However, there is no icon downloaded on the desktop.

 

Thanks in advance for your ongoing development. 

Bildschirmfoto 2022-01-26 um 11.09.04.png

Link to comment
On 1/26/2022 at 11:10 AM, DJay said:

Thanks for your work. 

But the Workflow is not working 100% for me.

I can save icons from installed Apps. They are saved on the desktop.

I can search for icons in App store (set to de). Results are showing up and the notification is showing "Icon extraction successful". However, there is no icon downloaded on the desktop.

 

Thanks in advance for your ongoing development. 

Bildschirmfoto 2022-01-26 um 11.09.04.png

 

Hey DJay!

Thanks for using my workflow! Sorry to hear it not working properly tho… I had same problem before. In my case turns out I had installed python3 in 2 folders – /usr/bin/ and /usr/local/bin. The latter had Pillow installed but not the first one. And that first one was used by Alfred.

 

If you can, open Alfred preferences, go to Workflows, find Get App Icon workflow, select element like on the attached screenshot, then turn on debugging with Only selected object(s) selected. Then run your workflow and look for any errors that might appear there.

CleanShot 2022-01-28 at 11.59.26.png

Link to comment

Thanks a lot.

Here's the output.

 

Probably something with PIL?

But I'm not sure how to fix it. 😕 

 

daniel@iMac2021 ~ % pip install --user Pillow
Requirement already satisfied: Pillow in ./Library/Python/3.10/lib/python/site-packages (9.0.0)
daniel@iMac2021 ~ % python3 -m pip install --upgrade pip
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (21.3.1)
daniel@iMac2021 ~ % python3 -m pip install --upgrade Pillow
Requirement already satisfied: Pillow in ./Library/Python/3.10/lib/python/site-packages (9.0.0)

 

[14:32:14.734] Logging Started...
[14:32:52.445] ERROR: Get App Icon[Run Script] % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 35132  100 35132    0     0   152k      0 --:--:-- --:--:-- --:--:--  156k
Traceback (most recent call last):
  File "mask.py", line 4, in <module>
    import sys, PIL
ModuleNotFoundError: No module named 'PIL'
mv: rename /Users/daniel/Desktop/HomeDevices-iOS.png.png to /Users/daniel/Desktop/HomeDevices-iOS.png: No such file or directory
[14:32:52.451] Get App Icon[Run Script] Processing complete
[14:32:52.452] Get App Icon[Run Script] Passing output '/Users/daniel/Desktop/HomeDevices-iOS.jpg
  /Users/daniel/Desktop/HomeDevices-iOS.png
' to Post Notification

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...