Jump to content

RodgerWW

Member
  • Posts

    378
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by RodgerWW

  1. OK, I don't know if you have already done this, but I'll post this for others so they know what to do with this particular issue: 1: Open Alfred2's preferences 2: Select the workflow "About This Mac" 3: Double click on the script filter "about" to open the script it runs 4: find the line LAST4SERIAL=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print substr( $0, length($0) - 3, length($0) ) }') 5: modify the awk command to change the length from 4 characters to 3 or just replace that line with the following LAST4SERIAL=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print substr( $0, length($0) - 2, length($0) ) }') 6: You will also need to change those lines in the /bin/bash run scripts for the "ctrl" and "alt" modifiers ... for those scripts to actually work with 3 digit spec. (thanks derico for pointing this out!)
  2. OK, this LOOKS like it might be hanging up on a script. ONE thing that comes to mind is the curl request for the machine code that Clinton mentioned as well. type the following in terminal but NOTE the {DIGITSHERE}: curl -o - "http://support-sp.apple.com/sp/product?cc={DIGITSHERE}〈=en_US" REPLACE {DIGITSHERE}, including the {} with the last 4 characters of your serial as shown in about this mac (system menu one) if you get an error as shown in Clinton's post, then it's required to put the last 3 instead. Otherwise, it will just show your proper machine code in xml that is the MAJOR change in v2 ... so let me know if that was it, just so we can eliminate that
  3. Crap, I was afraid they still used 3 sometimes. I currently have no idea how to compensate for this automatically. If anyone has any ideas, please step forward! Just had a brain fart. SO, what IF I I do a curl request with 3 characters, parse, and if the xml contains <error> skip, then goto a curl request with 4 characters? I THINK Apple has only ever used either 3 or 4. Hmmm, more learning to do, especially on how to do all that. Upon testing my own mac serial with just 3 characters, all I get is the wrong model identifier, NOT an error in the xml ... damn. So far the only way I know of how Apple gets that link is the method I'm currently using. And yet, it works on ALL macs when we do it from the system menu ... so, perhaps the exact method Apple uses in the OS is not documented correctly online. This is going to bug me!
  4. @ Ddyracer : Do you happen to have v1 & v2 installed at the same time using the same keyword? I'm not exactly sure how that would be possible because the bundleID is the same. I need a little more info I think. What exactly happens when you start typing the keyword? @ ctwise: Is that the output from written "atm.txt"? I think I may be able to fix this if I can figure out how to parse the multiple values with the same names. ALSO, I have to admit I am unfamiliar with the broad range of all the Macs out there, but is this perhaps one of those that has the multi-cards? If so, I can actually test out how to change this with my Son's Macbook Pro when he gets the time.
  5. This is pretty straightforward ... for Safari at least. Make a new workflow, from "Templates"\"Essentials"\"Keyword to script" Double click on Keyword in the workflow area and set up your keyword with no argument, then save. Double click on Run Script and in the language drop down select /usr/bin/osascript. in the Script area paste this: tell application "Safari" activate set theURL to URL of front document set the clipboard to theURL & return end tell then click save. Then load whatever site you want in Safari, open alfred and type your keyword and you will have Safari's url on the clipboard.
  6. Wow ... this is nice and thank you! Now, if we could only get the other 'helpers' to work with ML so the prefs don't have to pop up.
  7. OK, unfortunately with ML we need to use gui scripting for this particular issue because Apple has changed the sound a bit, BUT, you don't HAVE to activate system prefs. That brings it to the front. Check out the last post by "Lri" HERE where Lri states ... reveal anchor "" of pane id "" reveals a specific tabThis works for me in selecting a specific output, and yes, System Prefs does show up in the dock, but it is not made active or visible. The script runs, then goes away.
  8. OK folks here is Verison02 This version is outdated and the final can be found HERE. Upon starting to type the KEYWORD "about" you will see: [image removed] When completing the keyword "about": [image removed] When selecting an item, then holding "fn" + "ENTER" it will copy the TITLE value to the clipboard. When selecting an item, then holding "shift" + "ENTER" it will paste the title value to the front most app. For Example: If I mouse down to "System Version (Build)" and hit "fn" + "ENTER" it will COPY "OS X 10.8.3 (12D78)" to my clipboard. The workflow now includes 2 more modifiers! Holding "ctrl" + "ENTER" anywhere, will open the Apple Support Site for YOUR hardware in your default browser. Holding "opt" + "ENTER" anywhere, will open the Apple Technical Specifications Site for YOUR hardware in your default browser. These two new added functions simulate the support links in "About This Mac", selecting "More Info", selecting the "Support" tab, then selecting either "Specifications" or "Hardware Support." I personally thought this was a wicked idea to minimize the amount of mouse movements and clicking necessary just to see if my hardware is still under warranty and what my support options are. I've come a LONG way since using Alfred1 to simply launch apps ... this is all done with ZERO scripting knowledge folks! NOTES: I still need to figure out the hardware icon that is displayed beside the human readable hardware. For NOW, I have it showing the "iMac (27-inch, Mid 2011)" icon Apple uses for MY hardware. This is not dynamic yet, as I need to figure out a reliable way to grab the icons Apple uses from "CoreTypes.bundle." For now, you 'advanced' users can simply grab the appropriate icon for your hardware from "CoreTypes.bundle," copy it over to the workflow folder, then edit the <icon> attribute in the xml output to reflect the proper icon. OK, so here's what I need from you fine folks reading this: 1: Please, try out the hotkeys, specifically the "ctrl" and the "alt" modifiers. I need to know that the method used to grab the data is current, and accurate. Apple has changed this over the years, and I am hoping they are sticking with the method I'm using for ALL hardware. 2: Alfred2 and/or scripting (/bin/bash/) GURUs ... please look over the scripting in the workflow and help me clean it up if it needs to be. So far, everything 'works' for me, but as stated earlier, I've done all of this with zero knowledge and I would hate to have a sloppy workflow here.
  9. @ R4z3r : Ya, I found that too, BUT, I actually wanted to show the type and timing as well. There have been times when I just can't remember the exact specs. OK, I found out how to parse the multiple values for RAM! I also added the graphics card to the 'flow' because that may prove useful to some. {workflow NOT updated here yet, as I am in the middle of a bunch of stuff for it, AND, 'feels' close to finished so I MAY just release in the proper forum when done.} Currently I am cleaning up the icons so that they appear as clean as they possibly can. OK, I finally found out how Apple does the Human Readable Format for the machine from the model serial ... "iMac (27-inch, Mid 2011)"! NOW, I need to figure out how to parse out the data needed to send the curl request.
  10. OK, I could not leave this one alone because it was eating away at me. I am posting what I have so far here, and not in the workflow forum, because this is NOT 100% in my eyes, but it is certainly functional. This workflow is outdated and the final can be found here The keyword is currently "about" and you will see: [image removed] Upon completing the keyword you will see: [image removed] I have two clipboard outputs assigned to the script filter so that: 1: Selecting the result and hitting enter with "fn" will copy to the clipboard. 2: Selecting the result and hitting enter with "shift" will paste the value to the front most window. Currently, the workflow results show: 1: Uptime 2: System Serial Number 3: System Version with build 4: Processor 5: Ram NOW, the RAM is the issue for me ... STILL haven't found a way to parse the data from 'SPMemoryDataType' so I am currently using "SPHardwareDataType" and adding the ram speed/type manually. NOTE: inside the workflow folder I have included icons for "Leopard" "Lion", the workflow is currently assigning the OS icon to "MountainLion" as that is what I am using. Also, I have 2 CPU icons, i5 and i7, i5 is used, again, because this is my system. Also, the back of the iMac icon is used for serial, yup, you guessed it, because that's my system. ALL icons are from Apple, either from their site or from the OS. Ultimately, it would be nice to have the script parse the data and use whatever icon for whatever CPU/Mac/OS is in the file ... but as stated earlier, I know VERY little of bin/bash ... so hopefully someone else can contribute to this.
  11. I'll get the ball rolling on this one: PLEASE keep in mind I know VERY little about scripting and even less about 'working with text' using awk and such ... with that in mind, here is a start: Everything you need to obtain from "About This Mac" can be found with 3 terminal commands: sw_vers system_profiler SPHardwareDataType system_profiler SPMemoryDataType Now, I'm thinking that if you make a new workflow in Alfred2, add a script filter, set your keyword and select with space and argument optional, set the language to "/bin/bash" and in the script area paste the following: sw_vers > atm.txt system_profiler SPHardwareDataType >> atm.txt system_profiler SPMemoryDataType >> atm.txt This will create a txt file in the workflow folder named "atm.txt" with all of the info you need. Parsing the data would be done using awk, and don't forget to add the xml outputs for whatever you want to display. I am currently unaware of how to exactly output to clipboard when selecting and hitting enter on any of the output fields. Oh, also, if you want the results to be listed in a certain 'non-learning' order, be sure to give unique identifiers to the the item fields. Seriously, I've almost got this working myself with ZERO knowledge ... give it a go ... it's fun to learn!
  12. Would it be possible to define a standard size to display for the icon in the results? Currently, when cycling the "Result Padding", the icon sizes change from 28, 30, 32, 34 and 36px. This makes certain icons look like complete garbage ... especially if the icons contain single pixel lines. The idea, is that if an icns/tiff/jpg/pdf IS or CONTAINS a certain size, Alfred will honour it in the results. So, if for some reason I wish to have my results icons displayed at 16px, regardless of padding or font height with results, the icon will always show centered at 16px in the image results area. Alternately, if I wish to have my icon show at 64px, and have the text to the right of it smaller, the text results would be centered in it's area. I do realize that the theming/appearance area of Alfred2 is a work in progress but this has been bugging me as a visual type person who is in love with 'pixel perfectness'
  13. Workflow to toggle the {selected file(s)} extension visibility. Bound to a hotkey CONTROL+SHIFT+E, but you can modify it to your preference. USAGE: Select a file or some files in Finder and hit "CONTROL+SHIFT+E." If no file is selected, a dialog pops up, and it disappears in 5 seconds if you do not want to click "OK" REASON: I have a video folder set up in Finder to display my movies with Cover Art and Info of the video. I wanted to display JUST the filename of the video and not the extension, so I came up with this. Full disclosure is in the readme of the workflow. DOWNLOAD
  14. I was looking for something like this. I currently have an alias set up in terminal for doing this, but wanted it done with Alfred. Thank You!
×
×
  • Create New...