-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for M1 #3
Comments
Hi! I can't reproduce your issue on my side. The machine.png icon is retrieved by the |
Hi, Really nice. Thank you. I'm waiting for your return 😉 |
@GrimlocK38, sorry for keeping you waiting. To provide more clues as to where the problem might lie, and—just as importantly—where it does not, would you mind running the script below from within Script Editor ? It's a modified, stripped-down version of the script used by the Alfred workflow, containing only the essential lines necessary for generating the image appropriate for the machine. Upon execution, the script should return either
Removing that line will allow whatever image is generated by this script to open in Preview for you to discern whether or not it's what one would expect (i.e. not simply a blank image). use framework "Foundation"
use framework "AppKit"
property this : a reference to the current application
property NSWorkspace : a reference to NSWorkspace of this
property sharedWorkspace : a reference to NSWorkspace's sharedWorkspace
property filepath : "/tmp/machine.tiff" as «class furl»
set root to the sharedWorkspace()'s iconForFileType:"'root'"
set tiff to root's TIFFRepresentation()
tell tiff to writeToURL:filepath atomically:yes
return the result
tell application id "com.apple.finder" to open filepath ¬
using application file id "com.apple.Preview" |
Hi @ChristoferK I waited wisely but no problem :) I just tested and got the right result I removed the line and got the picture. Am I replacing everything in the script now ?
Thanks |
I take care of this part. Please, post the Terminal output for |
Ok @xilopaint. Here
|
Could you test this build and post here the Alfred UI output image? It should fix the processor part. I need the Terminal output for |
I test. Thanks and here the processor part.
Result For image of processor possible logo Apple or not ? |
I'm looking for an icon for Apple M1. Btw, |
I don't get what you tell here. |
Sorry @xilopaint I don't know if it's the script that at modify this part. |
I'm struggling to understand you. Please, use Google Translate, it should do a good job with French. The icon your image shows for the graphic chipset doesn't come from the workflow I distribute. Where did you get it? |
I'm not asking where you changed but where you got the icon from. |
@xilopaint, here : https://macosicons.com |
Not just yet. That was checking the core functionality of the script was doing what it was meant to, which means the problem with the original script must be in the conversion of the TIFF data to PNG data. The script achieved this previously using Image Events, which is the part of the process that is most likely to fail from upgrading to Big Sur (although it's strange that it appears to work as before for @xilopaint). To be safe, I'll rewrite the script to perform the conversion without using Image Events. On a minor note, the Objective-C method used to create the icon, namely I'll post an updated script this week. Thanks for your patience. |
Hi @ChristoferK, Thanks for your return. No problem, I wait wisely. Thanks to you 2 for the follow-up and the update :) |
@ChristoferK any news on this? |
Hi, I wait wisely. hoping that chris will be able to give us this update. Thanks again |
@xilopaint @GrimlocK38 Hello, thanks for nudging me. I've been distracted by multiple projects, plus my day job. [ I'm a medical doctor and the entire year has been swallowed by CoViD, my time hasn't felt like my own. ] I did write the replacement handler for converting a TIFF to and saving as a PNG. I have, erm, 164 script documents open in CotEditor, so it's in one of these. I've just written a JXA routine to search the open documents and bring the windows to the front, so I'll post some code this weekend. Unrelated query: On contemplating installing Big Sur this weekend also, from the perspective of the impact the new OS has had on scripting, and any software
|
@ChristoferK Thank you for your service, Doc! |
Here we go, guys. This is the chunk of code that will safely generate the machine icon, saving it as a PNG image file, and returning the path to the file: use scripting additions
use framework "AppKit"
property this : a reference to the current application
property nil : a reference to missing value
property NSBitmapImageRep : a reference to NSBitmapImageRep of this
property NSWorkspace : a reference to NSWorkspace of this
property filepath : POSIX file "/tmp/machine.png"
tell (TIFFRepresentation of iconForFileType_("'root'") ¬
in the sharedWorkspace of NSWorkspace) to tell ¬
representationUsingType_properties_(4, nil) of ¬
(NSBitmapImageRep's imageRepWithData:it) to if ¬
writeToURL_atomically_(filepath, yes) then ¬
return the filepath's POSIX path Do you want me to upload this as an |
Yes, please. After we test it you can submit a PR if everything is ok. |
@ChristoferK could you upload the file so we can test the new implementation? |
Apple Silicon support has been added. |
Hi
Is an update possible?
Thanks
The text was updated successfully, but these errors were encountered: