iNinja Posted January 12, 2018 Posted January 12, 2018 18 hours ago, RodgerWW said: OK, so it would seem that something in the Alfred workflow folder is not getting cleared in this case. In the workflow folder you will have a text file called "mymac.txt". This text file is more-than-likely showing the system as being the early 2014 model. You also should have a png file called "mymac.png" and it is probably clear/transparent as the identifier for your new system "MacBookPro13,2" is not in the "HardwareIcons.xml" file also in the workflow's folder. First, I would suggest removing not only the workflow, but also any trace of it on the new system. Then download the workflow and install it fresh. (Go to first post/page to download as I have just updated the workflow) Then run the workflow so it can create the above mentioned text file and image ... The text file should be correct now that everything has been removed everywhere and the workflow installed fresh. How can I remove this identifier from my system? I did see the mymac.txt file you've mentioned showing "MacBook Air 13-inch, Early 2014 G5RQ" HardwareIcons.xml is also not showing MacbookPro13,2. However, I did not see a "mymac.png" file in the workflow directory.
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 3 hours ago, flome said: The MBP icon isn't showing up for me Please make sure you downloaded the updated 2018 workflow for Alfred 3.
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 1 hour ago, iNinja said: I did see the mymac.txt file you've mentioned showing "MacBook Air 13-inch, Early 2014 G5RQ" Try manually deleting the txt files from the workflow directory ... then running the workflow again to see if the workflow recreates the files properly. Also, did you download the 2018 workflow for Alfred 3 I just updated with all hardware?
flome Posted January 12, 2018 Posted January 12, 2018 13 hours ago, RodgerWW said: Please make sure you downloaded the updated 2018 workflow for Alfred 3. I double checked and I am indeed running the latest version.
iNinja Posted January 12, 2018 Posted January 12, 2018 14 hours ago, RodgerWW said: Try manually deleting the txt files from the workflow directory ... then running the workflow again to see if the workflow recreates the files properly. Also, did you download the 2018 workflow for Alfred 3 I just updated with all hardware? Hurray that worked! Thanks for your assistance. I deleted the txt files as you've stated and downloaded 2018 update. I did download the Alfred 3 workflow a few days ago, but it was still showing 2017 then.
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 1 hour ago, flome said: I double checked and I am indeed running the latest version. Also did you run "xabout" to reset the workflow after downloading the 2018 version?
flome Posted January 12, 2018 Posted January 12, 2018 24 minutes ago, RodgerWW said: Also did you run "xabout" to reset the workflow after downloading the 2018 version? Ok, just tried that now. Unfortunately, still nothing. Here's what the debug log is showing. It may help. Starting debug for 'About This Mac' [2018-01-12 11:07:38][STDERR: input.scriptfilter] /bin/bash: line 15: [: too many arguments cat: SPDisplaysDataType: No such file or directory cat: SPDisplaysDataType: No such file or directory [2018-01-12 11:07:58][input.scriptfilter] Queuing argument '' [2018-01-12 11:07:59][input.scriptfilter] Queuing argument '' [2018-01-12 11:08:00][input.scriptfilter] Script with argument '(null)' finished [2018-01-12 11:08:00][STDERR: input.scriptfilter] /bin/bash: line 15: [: too many arguments cat: SPDisplaysDataType: No such file or directory cat: SPDisplaysDataType: No such file or directory [2018-01-12 11:08:00][input.scriptfilter] <?xml version="1.0"?> <items> <item arg="MacBook Pro 15-inch, 2017" valid="yes"> <title>MacBook Pro 15-inch, 2017 (MacBookPro14,3)</title> <subtitle>System (Model Identifier)</subtitle> <icon>mymac.png</icon> </item> <item arg="2.9 GHz Intel Core i7"> <title>2.9 GHz Intel Core i7</title> <subtitle>Processor</subtitle> <icon>cpu.png</icon> </item> <item arg="16 GB 2133 MHz LPDDR3"> <title>16 GB 2133 MHz LPDDR3</title> <subtitle>Memory</subtitle> <icon>ram.png</icon> </item> <item arg="Intel HD Graphics 630 4 GB"> <title>Intel HD Graphics 630 4 GB</title> <subtitle>Onboard Graphics</subtitle> <icon>graphicsintelhd.png</icon> </item> <item arg="Radeon Pro 560"> <title>Radeon Pro 560</title> <subtitle>Resolution: 2880 x 1800</subtitle> <icon></icon> </item> <item arg="C02TV2NRHTD6"> <title>C02TV2NRHTD6</title> <subtitle>Serial Number</subtitle> <icon>AppleCare.png</icon> </item> <item arg="macOS 10.13.2 (17C205)"> <title>macOS 10.13.2 (17C205)</title> <subtitle>System Version (Build)</subtitle> <icon>HighSierra.png</icon> </item> <item arg="50 minutes"> <title>50 minutes</title> <subtitle>Time Since Boot</subtitle> <icon>uptime.png</icon> </item> </items>
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 11 minutes ago, flome said: Ok, just tried that now. Unfortunately, still nothing. Here's what the debug log is showing. It may help. Hmm, Can you open terminal and type the following: system_profiler SPHardwareDataType | grep "Model Identifier" and tell me what it says for you identifier?
flome Posted January 12, 2018 Posted January 12, 2018 (edited) 8 minutes ago, RodgerWW said: and tell me what it says for you identifier? Model Identifier: MacBookPro14,3 Edited January 12, 2018 by flome
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 Hmm, I have to admit I am stumped with this one. The identifier is definitely in the xml, albeit 3 times for space grey silver and non touch. Perhaps open the xml in textedit, do a search for "MacBookPro14,3" and delete the 2 lines that are NOT yours and see if that works?
deanishe Posted January 12, 2018 Posted January 12, 2018 A rather minor thing, but would you consider storing the generated txt files in the workflow's data or cache directory, not in the workflow directory? The issue is that files in the workflow directory get synced between machines, so when I use the workflow to quickly check which video card my Mac has or what the numerical version of the OS is (I can never ever seem to remember which is 10.10, 10.11, 10.12 etc.), the cache files often contain the data from the wrong Mac, so it takes a lot longer than need be to load.
RodgerWW Posted January 12, 2018 Author Posted January 12, 2018 54 minutes ago, deanishe said: A rather minor thing, but would you consider storing the generated txt files in the workflow's data or cache directory, not in the workflow directory? This is new to me, but I will look into it for sure.
deanishe Posted January 12, 2018 Posted January 12, 2018 39 minutes ago, RodgerWW said: This is new to me, but I will look into it for sure. The data and cache dirs? Since about Alfred 2.4, the paths are available to your workflow via the alfred_workflow_data and alfred_workflow_cache environment variables. You still have to create the directories yourself, mind you.
flome Posted January 12, 2018 Posted January 12, 2018 3 hours ago, RodgerWW said: Hmm, I have to admit I am stumped with this one. The identifier is definitely in the xml, albeit 3 times for space grey silver and non touch. Perhaps open the xml in textedit, do a search for "MacBookPro14,3" and delete the 2 lines that are NOT yours and see if that works? No dice. I verified the icon files existed also.
Serge Posted February 3, 2018 Posted February 3, 2018 It’s been a long time since I’ve been here and I just came across this great workflow. Thanks Rodger!
xilopaint Posted June 12, 2019 Posted June 12, 2019 (edited) I've just released a new About This Mac workflow on GitHub based on Rodger's work. The new workflow should be more fast and reliable since I've fixed some bugs and rewritten the code to not write any more .txt files. The xabout keyword was suppressed since the data is generated in each run so no need to reset the workflow. Edited June 12, 2019 by xilopaint
xilopaint Posted June 12, 2019 Posted June 12, 2019 (edited) On 1/12/2018 at 5:33 PM, deanishe said: A rather minor thing, but would you consider storing the generated txt files in the workflow's data or cache directory, not in the workflow directory? The issue is that files in the workflow directory get synced between machines, so when I use the workflow to quickly check which video card my Mac has or what the numerical version of the OS is (I can never ever seem to remember which is 10.10, 10.11, 10.12 etc.), the cache files often contain the data from the wrong Mac, so it takes a lot longer than need be to load. Your issue is fixed in the new workflow. See my last post. Btw, would you help me to find a way to generate mymac.png programatically without the need of using the HardwareIcons.xml file? All Mac icons are located in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ but I didn't find a way to correlate one of them to the user machine. There are 3 icons for the MacBook Air in this folder as an example: com.apple.macbookair.icns com.apple.macbookair-11-unibody.icns com.apple.macbookair-13-unibody.icns. Is there any .plist file determining which one should be displayed in About This Mac.app? I don't know if @RodgerWW is still active on the Forum. Maybe he can contribute for this discussion. Edited June 12, 2019 by xilopaint
deanishe Posted June 12, 2019 Posted June 12, 2019 26 minutes ago, xilopaint said: Is there any .plist file determining which one should be displayed in About This Mac.app? Not that I know of. The model names are contained in /System/Library/PrivateFrameworks/ServerInformation.framework/Versions/A/Resources/English.lproj/SIMachineAttributes.plist, and I found some code that the author says can convert a model name into its icon, so perhaps you could read the model names from the plist and feed them to that code to get the right icons? xilopaint 1
xilopaint Posted June 12, 2019 Posted June 12, 2019 9 minutes ago, deanishe said: Not that I know of. The model names are contained in /System/Library/PrivateFrameworks/ServerInformation.framework/Versions/A/Resources/English.lproj/SIMachineAttributes.plist, and I found some code that the author says can convert a model name into its icon, so perhaps you could read the model names from the plist and feed them to that code to get the right icons? Oh, that looks good! I just don't know anything of Swift or Objective-C (I'm not even sure which of the two languages that code snippet refers to). If anyone can submit a PR I will be grateful. Otherwise I will have to learn how to implement this.
xilopaint Posted June 12, 2019 Posted June 12, 2019 (edited) 5 hours ago, deanishe said: Not that I know of. The model names are contained in /System/Library/PrivateFrameworks/ServerInformation.framework/Versions/A/Resources/English.lproj/SIMachineAttributes.plist, and I found some code that the author says can convert a model name into its icon, so perhaps you could read the model names from the plist and feed them to that code to get the right icons? Hey, don't you think the one-line code mentioned in the SO question you linked is more suitable to my needs? EDIT: btw, is this line Swift or Objective-C? Edited June 13, 2019 by xilopaint
deanishe Posted June 13, 2019 Posted June 13, 2019 5 hours ago, xilopaint said: Hey, don't you think the one-line code mentioned in the SO question you linked is more suitable to my needs? Which one-liner? There is both Swift and Objective-C in that thread.
xilopaint Posted June 13, 2019 Posted June 13, 2019 1 minute ago, deanishe said: Which one-liner? There is both Swift and Objective-C in that thread. The one in the question, not in the answers.
deanishe Posted June 13, 2019 Posted June 13, 2019 3 minutes ago, xilopaint said: The one in the question, not in the answers. Don't know. That returns an NSImage, but you need a filepath. I don’t know if you can get the filepath from an NSImage. I’ll have a look what I get home from work.
xilopaint Posted June 13, 2019 Posted June 13, 2019 1 minute ago, deanishe said: Don't know. That returns an NSImage, but you need a filepath. I don’t know if you can get the filepath from an NSImage. I’ll have a look what I get home from work. Well, I don't necessarily need a filepath. If it gives me a copy of the .icns or even better a .png the problem is solved.
deanishe Posted June 13, 2019 Posted June 13, 2019 7 minutes ago, xilopaint said: Well, I don't necessarily need a filepath. If it gives me a copy of the .icns or even better a .png the problem is solved. How are you going to pass an NSImage to Alfred?
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