mcskrzypczak Posted May 13, 2015 Share Posted May 13, 2015 (edited) 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 Screenshotshttp://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 January 26, 2022 by mcskrzypczak Updated to version 2.2 gohoyer, jesused and Chris Messina 1 2 Link to comment
deanishe Posted May 15, 2015 Share Posted May 15, 2015 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
mcskrzypczak Posted May 18, 2015 Author Share Posted May 18, 2015 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
Serge Posted December 2, 2015 Share Posted December 2, 2015 (edited) 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 December 2, 2015 by Serge Link to comment
mcskrzypczak Posted December 2, 2015 Author Share Posted December 2, 2015 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
Serge Posted December 2, 2015 Share Posted December 2, 2015 (edited) Done. Thanks very much Maciej for this very quick reply. Edited December 2, 2015 by Serge Link to comment
mcskrzypczak Posted December 2, 2015 Author Share Posted December 2, 2015 No problem! Link to comment
gingerbeardman Posted January 13, 2016 Share Posted January 13, 2016 (edited) 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 January 13, 2016 by gingerbeardman Link to comment
gingerbeardman Posted January 24, 2016 Share Posted January 24, 2016 (edited) 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 January 24, 2016 by gingerbeardman Chris Messina 1 Link to comment
mcskrzypczak Posted May 21, 2016 Author Share Posted May 21, 2016 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
Evans Thompson Posted August 31, 2016 Share Posted August 31, 2016 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 Link to comment
DJay Posted June 7, 2019 Share Posted June 7, 2019 (edited) Has this workflow stopped working with Alfred 4? 🤔 Search App Icon online is not working for me. Thx Edited June 7, 2019 by DJay Link to comment
Bhishan Posted June 12, 2019 Share Posted June 12, 2019 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
Kaihao Posted October 21, 2019 Share Posted October 21, 2019 A simple Fix for Alfred 4.0. Right click the workflow, select "open in Finder". Open file acshell.sh. Then Change all the tell application "Alfred 2" to tell application "Alfred 4" Done! DJay and Chris Messina 1 1 Link to comment
DJay Posted October 21, 2019 Share Posted October 21, 2019 Thanks a lot. That was a good hint. I now can see a list of Apps again but unfortunately the icon is not downloading to the desktop. Maybe something in relation to Catalina? 🤔 Link to comment
Kaihao Posted October 21, 2019 Share Posted October 21, 2019 (edited) I'm also using Catalina. This workflow works fine, except for system apps. In macOS Catalina, system apps(except Safari) are actually at /System/Applications, not /Applications. Edited October 21, 2019 by Kaihao Link to comment
Kaihao Posted October 21, 2019 Share Posted October 21, 2019 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. Chris Messina and DJay 1 1 Link to comment
DJay Posted October 21, 2019 Share Posted October 21, 2019 Thanks again for your reply and your time. Everything is working now. 👍 Link to comment
jmueller Posted December 29, 2019 Share Posted December 29, 2019 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
mcskrzypczak Posted January 24, 2022 Author Share Posted January 24, 2022 I've finally updated the action (see the first post for download). The new version require python3 and Pillow installed. Chris Messina 1 Link to comment
mcskrzypczak Posted January 25, 2022 Author Share Posted January 25, 2022 Once more updated as some bugs were squished (see the first post for download). Link to comment
mcskrzypczak Posted January 26, 2022 Author Share Posted January 26, 2022 And once again the workflow got updated to version 2.2 (see the first post for download and changelist) DJay and Chris Messina 2 Link to comment
DJay Posted January 26, 2022 Share Posted January 26, 2022 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. Link to comment
mcskrzypczak Posted January 28, 2022 Author Share Posted January 28, 2022 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. 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. Link to comment
DJay Posted January 28, 2022 Share Posted January 28, 2022 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now