RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Very very nice workflow! The accurate graphics are a very nice touch. I don't mind the identifier number—mine says (MacBookPro8,2). However, two things: 1. The copy/paste shortcuts (Fn and ⇧ Return) don't work for me. Edit: Actually, the other two actions aren't working either. The subtext shows up correctly, but each of them just launches http://www.apple.com/support/ 2. I would really like the "human readable" model info back. Like "MacBook Pro, Mid 2012" or whatever. Was that intentionally removed? Or is my system just being weird and it's still showing up for everybody else? I have a feeling you are running Mavericks ... I am looking into this. I do know that there is a missing plist file that I used to read from to get the Human Readable. I may have to go back to the 'curl' method. On my machine the copy and paste work fine. These are built-in Alfred functions, so, I have no idea why they wouldn't work for you. BUT, the link to the support site for the hardware (as it comes from the missing plist) just goto the support site you mentioned instead of for the exact model. Now, the OTHER issue may be that they (Apple) have once again changed the way in which that data is linked to ... but I doubt that, because when I use the Apple Menu 'About This Mac' the links there look the same and goto the correct places. So, if you are NOT running Mavericks, I need a bit more info like, OS, was it a clean install or a restore from TimeMachine ... or whatever. Because, no, the Human Readable was not removed and SHOULD work fine in everything up to Mountain Lion. I really hate to say this, but I need to wait for a bit to see exactly what Apple is doing ... Mavericks has a LOT of changes under the hood and I would like to wait for the final build before I attack the issues with full force.
Wildcard Posted July 6, 2013 Posted July 6, 2013 I have a feeling you are running Mavericks ... I am looking into this. I do know that there is a missing plist file that I used to read from to get the Human Readable. I may have to go back to the 'curl' method. On my machine the copy and paste work fine. These are built-in Alfred functions, so, I have no idea why they wouldn't work for you. BUT, the link to the support site for the hardware (as it comes from the missing plist) just goto the support site you mentioned instead of for the exact model. Now, the OTHER issue may be that they (Apple) have once again changed the way in which that data is linked to ... but I doubt that, because when I use the Apple Menu 'About This Mac' the links there look the same and goto the correct places. So, if you are NOT running Mavericks, I need a bit more info like, OS, was it a clean install or a restore from TimeMachine ... or whatever. Because, no, the Human Readable was not removed and SHOULD work fine in everything up to Mountain Lion. I really hate to say this, but I need to wait for a bit to see exactly what Apple is doing ... Mavericks has a LOT of changes under the hood and I would like to wait for the final build before I attack the issues with full force. Sorry, I should have included more info. I am NOT running Mavericks (and am not likely to). I'm running OS Lion 10.7.4 on a MacBook Pro from, I think, early-mid 2011. (It came with Snow Leopard but I got the Lion upgrade free because it came so soon after I got the computer...that should tell you something.) It's not a restoration from backup; just an ordinary OS. ...Yes, on the built-in "About this Mac" window (when I click the "more info") it tells me it's a 15-inch model from early 2011.
RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Sorry, I should have included more info. I am NOT running Mavericks (and am not likely to). I'm running OS Lion 10.7.4 on a MacBook Pro from, I think, early-mid 2011. (It came with Snow Leopard but I got the Lion upgrade free because it came so soon after I got the computer...that should tell you something.) It's not a restoration from backup; just an ordinary OS. ...Yes, on the built-in "About this Mac" window (when I click the "more info") it tells me it's a 15-inch model from early 2011. Wow, ok. DO you have the following file? ~/Library/Preferences/com.apple.SystemProfiler.plist If so, does it contain a KEY with the last 4 digits of your serial, and also a STRING with your model identifier? Also, did you try typing "xabout" to reset the workflow ... this will erase the txt files that the first run of the workflow creates ... then, just type "about" again, to rewrite the files based on the system. I have been fiddling around with the copy/paste ... but so far, I have NO idea why it's not working for you.
Wildcard Posted July 6, 2013 Posted July 6, 2013 Wow, ok. DO you have the following file? ~/Library/Preferences/com.apple.SystemProfiler.plist If so, does it contain a KEY with the last 4 digits of your serial, and also a STRING with your model identifier? Also, did you try typing "xabout" to reset the workflow ... this will erase the txt files that the first run of the workflow creates ... then, just type "about" again, to rewrite the files based on the system. I have been fiddling around with the copy/paste ... but so far, I have NO idea why it's not working for you. Tried about; nothing changed. Yes, the file is where and as you say, except that the key has those four digits, then a hyphen, then "en_US". Don't know if that makes a difference. Let me know if there's anything else I should be doing. Don't worry about the copy/paste...I just spotted why it's happening; has to do with a keyboard layout issue. Something I've got a separate topic on here http://www.alfredforum.com/topic/2719-browse-in-alfred-shows-finder-info-window-instead/ ...if you're interested. (The copy/paste will work only if Dvorak or "Dvorak - Qwerty ⌘" is the layout when Alfred STARTS, since that's the layout I use regularly. Unfortunately, if one of those IS the layout when Alfred starts, the "file actions" hotkey will not work from the Finder. But either way the model identifier doesn't show up.)
RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Tried about; nothing changed. Yes, the file is where and as you say, except that the key has those four digits, then a hyphen, then "en_US". Don't know if that makes a difference. Let me know if there's anything else I should be doing. Don't worry about the copy/paste...I just spotted why it's happening; has to do with a keyboard layout issue. Something I've got a separate topic on here http://www.alfredforum.com/topic/2719-browse-in-alfred-shows-finder-info-window-instead/ ...if you're interested. (The copy/paste will work only if Dvorak or "Dvorak - Qwerty ⌘" is the layout when Alfred STARTS, since that's the layout I use regularly. Unfortunately, if one of those IS the layout when Alfred starts, the "file actions" hotkey will not work from the Finder. But either way the model identifier doesn't show up.) The "en_US" is completely normal, and I parse that out with the workflow ... for ME it's "en_CA" because I'm located in Canada. Now, in the workflow folder for this workflow, there SHOULD be a "mymac.txt" file which contains only one line. So, do you have this file, and if so, I am ASSUMING it's blank? And, for further testing: Open up terminal and copy/paste the following into it then hit enter NOTE: REPLACE the AAAA with the last 4 digits of YOUR machine! curl -s "http://support-sp.apple.com/sp/product?cc=AAAA〈=en_US" | sed -E 's/.*<configCode>(.+)<\/configCode>.*/\1/' This curl command SHOULD return the human readable system. So for me, and MY last 4 digits I get "iMac (27-inch, Mid 2011)" returned. And just for clarity: did you type "xabout" to reset, or just "about"? You may have forgotten to add the X, or, it could just be the autocorrect kicking in when writing the post.
Wildcard Posted July 6, 2013 Posted July 6, 2013 (edited) The "en_US" is completely normal, and I parse that out with the workflow ... for ME it's "en_CA" because I'm located in Canada. Now, in the workflow folder for this workflow, there SHOULD be a "mymac.txt" file which contains only one line. So, do you have this file, and if so, I am ASSUMING it's blank? And, for further testing: Open up terminal and copy/paste the following into it then hit enter NOTE: REPLACE the AAAA with the last 4 digits of YOUR machine! curl -s "http://support-sp.apple.com/sp/product?cc=AAAA〈=en_US" | sed -E 's/.*<configCode>(.+)<\/configCode>.*/\1/' This curl command SHOULD return the human readable system. So for me, and MY last 4 digits I get "iMac (27-inch, Mid 2011)" returned. And just for clarity: did you type "xabout" to reset, or just "about"? You may have forgotten to add the X, or, it could just be the autocorrect kicking in when writing the post. Yes, I have mymac.txt, and yes it's blank. I used xabout to reset and verified that that file disappeared. Same result afterwards with "about." The copy/pasted curl command worked correctly. ...I'm wondering if this is another quirk showing up from Alfred's interaction with my unusual keyboard layout. Check out the topic I linked to earlier for more details. Also note that the copy/paste function from the "about" workflow is now working correctly, but the two functions that link to the apple website are still not working right. Edited July 6, 2013 by Wildcard
RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Yes, I have mymac.txt, and yes it's blank. I used xabout to reset and verified that that file disappeared. Same result afterwards with "about." The copy/pasted curl command worked correctly. ...I'm wondering if this is another quirk showing up from Alfred's interaction with my unusual keyboard layout. Check out the topic I linked to earlier for more details. Also note that the copy/paste function from the "about" workflow is now working correctly, but the two functions that link to the apple website are still not working right. Wow, this IS a weird one. I must confess I am completely unfamiliar with DVORAK. Heck, I am unfamiliar with coding as well. All of the work that I've done to get this workflow to where it is today was achieved with a heck of a lot of searching and trial and error! When I look at my script, and the commands IN it, I can not think of any reason WHY it wouldn't work, as OTHER parts of the workflow seem to work fine for you. Perhaps some characters register differently under DVORAK? But, I thought that was just in typing, not in actual scripting. If you reboot you computer into QWERTY (as mentioned in your other postings to get Alfred to behave) does this workflow work as expected (after resetting the workflow with "xabout" of course)? I do agree that there seems to be an 'issue' with DVORAK and Alfred, but I am not entirely willing (with my lack of knowledge) to pinpoint that as the culprit in THIS case.
Wildcard Posted July 6, 2013 Posted July 6, 2013 Wow, this IS a weird one. I must confess I am completely unfamiliar with DVORAK. Heck, I am unfamiliar with coding as well. All of the work that I've done to get this workflow to where it is today was achieved with a heck of a lot of searching and trial and error! When I look at my script, and the commands IN it, I can not think of any reason WHY it wouldn't work, as OTHER parts of the workflow seem to work fine for you. Perhaps some characters register differently under DVORAK? But, I thought that was just in typing, not in actual scripting. If you reboot you computer into QWERTY (as mentioned in your other postings to get Alfred to behave) does this workflow work as expected (after resetting the workflow with "xabout" of course)? I do agree that there seems to be an 'issue' with DVORAK and Alfred, but I am not entirely willing (with my lack of knowledge) to pinpoint that as the culprit in THIS case. Okay, just tested on the other login on this computer (QWERTY only). Copy/paste works fine, websites don't, and the identifier is still missing.
RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Okay, just tested on the other login on this computer (QWERTY only). Copy/paste works fine, websites don't, and the identifier is still missing. OK, temporarily, until I can pin this down (if it's even MY fault ... lol) open the "mymac.txt" file in the workflow folder. On line one (1) of the txt file, put the model identifier the way you want it to appear in Alfred IE: MacBook Pro (17-inch, Mid 2012) On line two (2) put the last 4 digits of your serial number as they appear in the Apple Menu/About This Mac - Hardware Serial Display IE: DGFE So, the text file will look like this: MacBook Pro (17-inch, Mid 2012) DGFE Then save it ... and this should alleviate the current issue. Just keep in mind, IF you type "xabout", this will reset YOUR mymac.txt to blank under the DVORAK layout ... I THINK. So, you would just need to re-enter those two lines if it goes blank.
Wildcard Posted July 6, 2013 Posted July 6, 2013 OK, temporarily, until I can pin this down (if it's even MY fault ... lol) open the "mymac.txt" file in the workflow folder. On line one (1) of the txt file, put the model identifier the way you want it to appear in Alfred IE: MacBook Pro (17-inch, Mid 2012) On line two (2) put the last 4 digits of your serial number as they appear in the Apple Menu/About This Mac - Hardware Serial Display IE: DGFE So, the text file will look like this: MacBook Pro (17-inch, Mid 2012) DGFE Then save it ... and this should alleviate the current issue. Just keep in mind, IF you type "xabout", this will reset YOUR mymac.txt to blank under the DVORAK layout ... I THINK. So, you would just need to re-enter those two lines if it goes blank. Worked like a charm, thank you. I just copied the text as it showed in Terminal from using that "curl" command. But just to reiterate, I don't think Dvorak is the issue after all, as the identifier is absent on my wife's login also—and she only ever uses the standard US Qwerty layout.
RodgerWW Posted July 6, 2013 Author Posted July 6, 2013 Worked like a charm, thank you. I just copied the text as it showed in Terminal from using that "curl" command. But just to reiterate, I don't think Dvorak is the issue after all, as the identifier is absent on my wife's login also—and she only ever uses the standard US Qwerty layout. Ah right, SO: You are using one computer with 2 different logins ... like, fast user switching? IS Alfred installed to "All Users of this computer" or just to the admin? Basically I'm trying to find out if both logins use the same Alfred Prefs/Workflows ... or even the same Sync Fonder.
Wildcard Posted July 7, 2013 Posted July 7, 2013 Ah right, SO: You are using one computer with 2 different logins ... like, fast user switching? IS Alfred installed to "All Users of this computer" or just to the admin? Basically I'm trying to find out if both logins use the same Alfred Prefs/Workflows ... or even the same Sync Fonder. Not the same prefs; no syncing; and the workflow folder is in the Library under the user Home folder, not in shared or system, so not the same folder there, either. Proof: I did the fix on my login; I checked "about" again on wife's login; still not showing up there. (I could do the fix, but she doesn't really use the tech-y stuff so much.)
RodgerWW Posted July 7, 2013 Author Posted July 7, 2013 Not the same prefs; no syncing; and the workflow folder is in the Library under the user Home folder, not in shared or system, so not the same folder there, either. Proof: I did the fix on my login; I checked "about" again on wife's login; still not showing up there. (I could do the fix, but she doesn't really use the tech-y stuff so much.) OK, so that is interesting too. The workflow initially uses "~/Library/Preferences/com.apple.SystemProfiler.plist" for the Human Readable Name and the serial of the system. So, since your login does not have that, it makes sense (I GUESS) that your wife's does not either.
Wildcard Posted July 8, 2013 Posted July 8, 2013 OK, so that is interesting too. The workflow initially uses "~/Library/Preferences/com.apple.SystemProfiler.plist" for the Human Readable Name and the serial of the system. So, since your login does not have that, it makes sense (I GUESS) that your wife's does not either. Mine has that, actually. The key seems to be in there correctly. I can quick look it, but not open it/view it, so I can't copy paste the exact key. But the file name is exact, and the CPU Names key includes the human readable line as expected....
RodgerWW Posted July 8, 2013 Author Posted July 8, 2013 (edited) Mine has that, actually. The key seems to be in there correctly. I can quick look it, but not open it/view it, so I can't copy paste the exact key. But the file name is exact, and the CPU Names key includes the human readable line as expected.... More strange: because if you have the file, it SHOULD work. I am wondering if it's the user switching or more precisely, how I do the directory for writing out the file ... try this for me please; Open Terminal and copy/paste the following line (as a single line) into it, and it enter. #defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist | awk '/CPU Names/{getline;print}' | awk '{$1=$2=""; print $0}' | sed -e 's/"//g' -e 's/);//g' -e 's/(//g' | sed 's/^ *//' > ~/Desktop/mymac.txt The above command SHOULD make a txt file called "mymac.txt" on your Desktop with the contents of the aforementioned plist in it. IF it does not, try the following command in Terminal and please NOTE the USERNAME, and change it to YOUR profile name (You may want to edit this before pasting into terminal due to Terminal's lack of cursor control and 2 values needing to be edited): #defaults read /Users/USERNAME/Library/Preferences/com.apple.SystemProfiler.plist | awk '/CPU Names/{getline;print}' | awk '{$1=$2=""; print $0}' | sed -e 's/"//g' -e 's/);//g' -e 's/(//g' | sed 's/^ *//' > /Users/USERNAME/Desktop/mymac.txt Please let me know if either of these work, and what the contents are of the mymac.txt ... not the ACTUAL contents, but if it does in fact write data into the file or if it is still blank. Edited July 8, 2013 by RodgerWW
Wildcard Posted July 9, 2013 Posted July 9, 2013 (edited) More strange: because if you have the file, it SHOULD work. I am wondering if it's the user switching or more precisely, how I do the directory for writing out the file ... try this for me please; Open Terminal and copy/paste the following line (as a single line) into it, and it enter. #defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist | awk '/CPU Names/{getline;print}' | awk '{$1=$2=""; print $0}' | sed -e 's/"//g' -e 's/);//g' -e 's/(//g' | sed 's/^ *//' > ~/Desktop/mymac.txt The above command SHOULD make a txt file called "mymac.txt" on your Desktop with the contents of the aforementioned plist in it. IF it does not, try the following command in Terminal and please NOTE the USERNAME, and change it to YOUR profile name (You may want to edit this before pasting into terminal due to Terminal's lack of cursor control and 2 values needing to be edited): #defaults read /Users/USERNAME/Library/Preferences/com.apple.SystemProfiler.plist | awk '/CPU Names/{getline;print}' | awk '{$1=$2=""; print $0}' | sed -e 's/"//g' -e 's/);//g' -e 's/(//g' | sed 's/^ *//' > /Users/USERNAME/Desktop/mymac.txt Please let me know if either of these work, and what the contents are of the mymac.txt ... not the ACTUAL contents, but if it does in fact write data into the file or if it is still blank. Um... Okay, this is weird. That command didn't do ANYTHING. Pasted it into terminal, tried the other one; nothing. No file. (Neither command made a file.) I've done enough perl and bash scripting that, while I don't follow all the commands you wrote there, I get the gist (I know, for instance, pipes, redirect outputs (>), and I could follow out the regexes if I wanted to.) One thing I don't get is the #defaults bit, though...don't know where this is breaking down. Edit: when the "#defaults" part is taken out, it creates the file on the Desktop but the file is empty. Edited July 9, 2013 by Wildcard
RodgerWW Posted July 9, 2013 Author Posted July 9, 2013 (edited) Um... Okay, this is weird. That command didn't do ANYTHING. Pasted it into terminal, tried the other one; nothing. No file. (Neither command made a file.) I've done enough perl and bash scripting that, while I don't follow all the commands you wrote there, I get the gist (I know, for instance, pipes, redirect outputs (>), and I could follow out the regexes if I wanted to.) One thing I don't get is the #defaults bit, though...don't know where this is breaking down. Edit: when the "#defaults" part is taken out, it creates the file on the Desktop but the file is empty. Very weird indeed! "defaults" let's us Mac users read or write to plist files. For instance, HERE is a list of commands on github for changing a bunch of preferences in OSX or for certain apps in OSX. These are all terminal commands for changing the default preferences. OK, so it would APPEAR that for some reason that one file is just not allowed to be read, even though you have it, and there is data in it. I mentioned before how I thought you might not have that file because of Mavericks, as I am in Mavericks right now and do not have that file. So, for now I will suggest the manual method from before (because I am currently at a COMPLETE loss as to why this is happening on your machine), and in the meantime I will TRY to find a better way of getting the Human Readable machine. I initially strayed from the curl method because I wanted to use local methods as sometimes people use their computers without net access, like, on the road. There has GOT to be another though, because we can all get that info without net in the Apple Menu 'About This Mac' ... just need to find Apple's method in Mavericks, because maybe that's how they did it in all the other OS versions too. Spoke too soon. It seems I DO have the plist now in Mavericks. Perhaps it is generated when actually going into the system menu and hitting 'About This Mac'? But, I am having a similar issue in that my original workflow will not generate the two lines in "mymac.txt." I am thinking this is possibly a permissions issue on the plist because I can use plistbuddy to read the file, but not defaults! I am unable to even convert the plist to xml with plutil in terminal due to permissions. Just passing on what I've found out so far. Edited July 9, 2013 by RodgerWW
RodgerWW Posted July 9, 2013 Author Posted July 9, 2013 OK folks. I have updated the Workflow in post 1 to correct some issues. Version is at 1.1 even though the filename is exactly the same. Please remember to type "xabout" in Alfred to reset the workflow after installing so the Workflow can write the files necessary. Special thanks goes out to [Wildcard] because without his particular 'issues' with the workflow, I would never have found it!
RodgerWW Posted October 8, 2013 Author Posted October 8, 2013 I'm running OS X 10.8.4 on a MBP 15" Mid-2012, and I can't seem to get this workflow to run. It hangs on "Retrieving & Parsing." Any suggestions? First: If you could check the workflow folder for me and tell me ... are the following files created? graphics.txt , hardware.txt , memory.txt , mymac.txt , software.txt A hang on retrieving USUALLY means there's a missing file or VALUE in a file is not formatted correctly. SECOND: Do you have the following file? “~/Library/Preferences/com.apple.SystemProfiler.plist” You SHOULD, but if it's a new/fresh install, you may have to run Apple's About this Mac from the menu bar once to get the system to write the file.
RodgerWW Posted October 9, 2013 Author Posted October 9, 2013 (edited) I do have all 5 of the files you listed above, and I also have the SystemProfiler.plist file. https://dl.dropboxusercontent.com/u/9469779/Screen%20Shot%202013-10-08%20at%2011.08.27%20PM.png But it still hangs on this. https://dl.dropboxusercontent.com/u/9469779/Screen%20Shot%202013-10-08%20at%2011.16.44%20PM.png OK, is your model identifier ‘MacBookPro9,1’ ? I DO have that included in the xml for the hardware icon. One other thing to try ... I ASSUME you are using a version of Alfred over 2.0.3, which removed the necessity of identifiers, BUT: 1: Open the workflow in Alfed, and double click on the 'about' script filter (the one with the silver Apple logo) 2: In the 'Script' area, scroll down to the bottom where the output starts “Alfred RESULTS Display” 3: Then, for EACH "<item>" ADD a UID equal to the "arg" so that: <item arg="$MACHINE" valid="yes"> BECOMES <item arg="$MACHINE" valid="yes" uid="$MACHINE"> Do that to all 8 <item> s, and try again please. Edited October 9, 2013 by RodgerWW
politicus Posted November 28, 2013 Posted November 28, 2013 @RodgerWW This is really a great workflow. I love it so much that I was thinking "I need this kind of workflow for any application of my Mac" What I am looking for is a fast way to get the version of any application. So I would type "about" (or any keyword), then "tab", then would select the application I want to have the version (with up and down keys), then hit "enter", then a growl notification would appear with the requested information. Do you have any plan adding feature? That would be awesome.
RodgerWW Posted November 28, 2013 Author Posted November 28, 2013 "I need this kind of workflow for any application of my Mac" What I am looking for is a fast way to get the version of any application. So I would type "about" (or any keyword), then "tab", then would select the application I want to have the version (with up and down keys), then hit "enter", then a growl notification would appear with the requested information. Do you have any plan adding feature? Well, 'About This Mac' was intended to simply recreate the menu bar item on OS X systems. So, I will not be adding to this workflow. What I would suggest though, is placing a request for what you want in the 'Workflow Help & Questions' forum. Be sure to include all info you would like the workflow to contain. I am sure someone will come up with something (perhaps even me), this is an awesome community here!
rouraito Posted March 14, 2014 Posted March 14, 2014 Nice workflow, thank you for creating it. Is it possible to add storage infos? (usage, available space)
RodgerWW Posted March 15, 2014 Author Posted March 15, 2014 Nice workflow, thank you for creating it. Is it possible to add storage infos? (usage, available space) Well, I did make another workflow: http://www.alfredforum.com/topic/1910-disk-usage/ I doubt I will add it to About This Mac as I personally think this workflow is robust enough on it's own for what it does.
jonathanwiesel Posted June 11, 2014 Posted June 11, 2014 I encountered a couple of errors on the last version: On the icon assignment there's an extra else: ... elif [ $SWVER == 10.8 ]; then OSICON=MountainLion.png else # <=== this one elif [ $SWVER == 10.9 ]; then OSICON=Mavericks.png else OSICON=Yosemite.png fi This breaks the workflow. On the other hand, I'm getting the following error, the workflow seems to work despite this: [ERROR: alfred.workflow.input.scriptfilter] Code 0: cat: SPDisplaysDataType: No such file or directory cat: SPDisplaysDataType: No such file or directory /bin/bash: line 119: [: ==: unary operator expected /bin/bash: line 123: [: ==: unary operator expected /bin/bash: line 127: [: ==: unary operator expected Hope it helps. Keep up the nice work.
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