Jump to content

Subject22

Member
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    10

Reputation Activity

  1. Like
    Subject22 reacted to Carlos-Sz in Workflow gives error when running AppleScript   
    The code below seems to work (does not verify if trash is empty):
    set trash_size to (do shell script "du -sk ~/.Trash/ | awk '{print $1}'") as integer set units to {"KB", "MB", "GB", "TB"} set i to 1 repeat while trash_size is greater than 1000 set trash_size to trash_size / 1000 set i to i + 1 end repeat set trash_size to roundTo(trash_size, 1) tell application "Finder" to set num_items to count (every item in trash) trash_size & item i of units & " for " & (num_items) & " items" as string on roundTo(n, numDecimals) set x to 10 ^ numDecimals (((n * x) + 0.5) div 1) / x end roundTo Note that I set i to 1 initially and call Finder to get trash items.
  2. Like
    Subject22 reacted to Carlos-Sz in Yosemite Spotlight Theme   
    Your theme made me think that my workflows should be tweaked for users that like to Hide result subtext (Alfred Preferences > Appearance > Options).
     
    Hiding the result subtext makes Alfred even cleaner.
     
    Great theme by the way and sorry for thinking out loud here in your topic…
  3. Like
    Subject22 got a reaction from ElderD in Open current Safari tab in Chrome - Improved   
    I removed Flash from my system long ago but occasionally I need to make use of the version bundled with Chrome to view certain web pages properly. There are a few workflows like this around, but as the only browsers I use are Safari and Chrome I wanted something a little more direct than Send URL which led me to this alternative made by Runar. There were a few issues with that workflow, so I made a version which (hopefully) deals with everything in a tidy and intelligent manner. 
     
    If Safari is either not open, or has no windows open, the workflow will post a notification saying so. If you'd like it to also post notifications when URLs are successfully sent to Chrome open the workflow folder (right click the workflow in Alfred and click Show in Finder) and edit the appropriate line in open_in_chrome.scpt (it's clearly marked). The reverse behaviour is also available (i.e.: sending URLs from Chrome to Safari).
     

     
     
    Hat tip to Carlos-Sz for getting Alfred to run the Applescript properly 🙂
     
    Download (v1.0.2): Open in Chrome
    GitHub
    Keywords: openinchrome, openinsafari
  4. Like
    Subject22 got a reaction from Carlos-Sz in Blur Alfred   
    A while back Andrew posted a technique for setting the degree to which Alfred's window blurs the background immediately behind it and CarlosNZ posted a workflow for changing this setting via Alfred. I got sick of having to restart Alfred every time I changed this so I added some code to automate the process. I thought I might as well post it here, just in case anyone was looking for something along these lines :-) Please bear in mind what Andrew said about this hack:
     

     


    Download: Blur Alfred Keyword: blur
  5. Like
    Subject22 got a reaction from Carlos-Sz in Cheeky little transparency blur hack for themes   
    Thanks! Here's a version that automatically applies the blur setting by restarting Alfred (and his preferences, if they're open) as per my Restart Alfred workflow :-) As with Restart Alfred, you can have this workflow invoke your Alfred hotkey to make Alfred show himself after a successful restart (see the linked thread for details).
     
    Download: Blur Alfred
    Keyword: blur
  6. Like
    Subject22 got a reaction from anbao1777 in Cheeky little transparency blur hack for themes   
    Thanks! Here's a version that automatically applies the blur setting by restarting Alfred (and his preferences, if they're open) as per my Restart Alfred workflow :-) As with Restart Alfred, you can have this workflow invoke your Alfred hotkey to make Alfred show himself after a successful restart (see the linked thread for details).
     
    Download: Blur Alfred
    Keyword: blur
  7. Like
    Subject22 reacted to Cassady in Open current Safari tab in Chrome - Improved   
    Legend! Many thanks for this - was having endless issues trying to view embedded videos in Safari (having killed off Flash plugins etc.)... Your solution has just made my purchasing the Powerpack absolutely worth it - and I'm only three workflows in!
  8. Like
    Subject22 reacted to Andrew in Displays preference pane no longer searchable   
    I've added a task ticket to investigate this further in the future... I may raise a bug with Apple so that Alfred doesn't have to put in a workaround for the missing icon.
  9. Like
    Subject22 reacted to dfay in Workflow: Units - convert currency length temperature weight and more   
    +1 for fncll's request for volume conversions.  The code is pretty clear so I may try to add this myself -- perhaps the original dev. could put it on github?
  10. Like
    Subject22 got a reaction from spencermountain in Open current Finder window in Terminal/iTerm and vice versa   
    Handy workflow! I made a context aware equivalent triggered by a hotkey. If you're in Finder when you use it it'll open the current directory in Terminal, if you're in Terminal when you use it it'll open the current directory in Finder. I didn't bother including iTerm as I never use it. I'm sure that anyone who's using this kind of workflow will be more than capable of adding support for iTerm, should they need it :-) I'd appreciate any critiques of the AppleScript code I wrote. It's fairly messy, but anything neater (in terms of code) was less robust in actual use.
     
    Download: Directory Switcher
  11. Like
    Subject22 reacted to rice.shawn in Workflows Help Workflow   
    Glad you like the idea. I haven't completely forgotten about this project, but currently, for my Alfred projects, it's behind one major one that should be released soon.
     
    Version 1 of WHW was a great idea, but it does suffer from usability concerns, and these were in part due to the way that I decided to generate the help files. I've since figured out much, much better ways to go about it, and I have some of the framework done for a better version.
     
    The next version won't use quicklook (well, I might have that as an option but not the default); instead, it'll use a custom viewer as default with other options of opening the file in a browser window and generating it as a PDF and opening it in Preview. Instead of generating markdown files, it'll instead generate richer HTML pages with quite a bit of javascript that should make navigation and layout much better. It'll have the option to just view one workflow as well as all of them. The plist parsing will be done quite a bit better for more accurate results. It will also allow workflows to define their own help files for richer content. If the help file exists in the workflow folder, then it will use that, and it will fall back on plist parsing. The workflow will also include an easy help generator for workflow authors so that they don't need to write out xml/json/plist files by hand. Lastly, it'll have a nice speed increase by "caching" the help files and regenerating them only when it senses that a workflow could have changed.
     
    I don't have an exact timeline to finish it, but it should be pretty sweet when the new version sees the light of day.
     
    Shawn
  12. Like
    Subject22 reacted to untoldwind in Yet another window layout workflow   
    I was not very happy with the existing solutions, so I just created my own.
     
    The workflow itself is quite simple just typ in the keyword "lay" (or chose another of your liking) followed by:
    full = Maximize left, right, top, bottom = Halves of screen topleft, topright, bottomleft, bottomright = Quaters of screen 11,12,13,21,22,23,31,32,33 = Thrids of screen 11-12,11-13,11-21,11-22 ... = Some other sizes based on thrids ... well the script is quite flexible, so I'm waiting for suggestions

     
    For MacOS 10.8 (Mountain Lion):
    The workflow itself can be found here:
    https://github.com/untoldwind/alfred2-layout/raw/1.0_Mountain_Lion/Layout.alfredworkflow
    and (obviously) its sources here:
    https://github.com/untoldwind/alfred2-layout
     
    For MacOS 10.9 (Mavericks):
    The version above does not work (unluckily). An alternative (though somewhat experimental) version can be found here:
    Release: https://github.com/untoldwind/alfred2-layout/raw/1.1_Mavericks/Layout.alfredworkflow
    Experimental (Bleeding edge): https://github.com/untoldwind/alfred2-layout/raw/master/Layout.alfredworkflow
     
    By the way: It is multi-screen-able. Even though you cannot move windows from one screen to another (yet?) the scripts tries to figure out with screen you mean (depending on the size of the visible area).
     
    A short note about the implementation:
    The script is written in python using PyObjC and the ScriptingBridge. This should be no problem as both is shiped as part of MacOS since 10.5. It the application supports scripting, the window is moved "directly". Unluckily some Applications do not support this, so there is a fallback using "SystemEvents". This only works if you have UI scripting enabled: http://www.macosxautomation.com/applescript/uiscripting/For 10.9 (Mavericks) this has slightly changed. A more detailed description can be found here: http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/ In our case "Alfred 2" requires UIScripting access At the moment there are no hotkeys defined, which should be straight forward though
  13. Like
    Subject22 reacted to valpackett in UNIX file permissions (chmod) converter   
    A very simple converter between symbolic and octal file permissions notation.
     


     
    Download!
     
    also check out the Android pixel density converter!
  14. Like
    Subject22 got a reaction from Carlos-Sz in To Dropbox 3.0 (formerly Move to Dropbox) + URL to the clipboard   
    Yep, you can. Alfred Preferences > Default Results. Go to the Search Scope pane and hit the plus button. Find your hard drive (or just your Dropbox folder, if that's all you want). Be warned that adding external drives to Alfred's search scope can have a small impact on performance. If you invoke Alfred while the disk has been spun down then you may find that Alfred pauses while the disk spins up again.
  15. Like
    Subject22 got a reaction from fascinator! in Open current Safari tab in Chrome - Improved   
    Haha, that's a little frightening Glad it works :-)
  16. Like
    Subject22 got a reaction from nikivi in Open current Safari tab in Chrome - Improved   
    I removed Flash from my system long ago but occasionally I need to make use of the version bundled with Chrome to view certain web pages properly. There are a few workflows like this around, but as the only browsers I use are Safari and Chrome I wanted something a little more direct than Send URL which led me to this alternative made by Runar. There were a few issues with that workflow, so I made a version which (hopefully) deals with everything in a tidy and intelligent manner. 
     
    If Safari is either not open, or has no windows open, the workflow will post a notification saying so. If you'd like it to also post notifications when URLs are successfully sent to Chrome open the workflow folder (right click the workflow in Alfred and click Show in Finder) and edit the appropriate line in open_in_chrome.scpt (it's clearly marked). The reverse behaviour is also available (i.e.: sending URLs from Chrome to Safari).
     

     
     
    Hat tip to Carlos-Sz for getting Alfred to run the Applescript properly 🙂
     
    Download (v1.0.2): Open in Chrome
    GitHub
    Keywords: openinchrome, openinsafari
  17. Like
    Subject22 got a reaction from fascinator! in Open current Safari tab in Chrome - Improved   
    OK, I've made those changes and uploaded a new version behind the link in the first post. Apple's support for AppleScript is a bit patchy these days so I had to research a few workarounds (there's also an annoying bug which causes Safari to calculate the number of windows it has open incorrectly). Everything seems to be working OK, but test it out and let me know how you go :-)
  18. Like
    Subject22 reacted to fascinator! in Open current Safari tab in Chrome - Improved   
    Will do! Thank you so much.
    Now get to it! Chop chop!
    /whips 
  19. Like
    Subject22 got a reaction from supr in Display Sleep   
    I believe the kernel panic issue was with PPC machines, not the Intel one you're doubtless using. There's an app available that simply executes that code and the reviews for it seem positive. You could either bundle the app with the workflow and call it with an AppleScript to eliminate the need for additional installs, or try to roll your own script with the code linked above (relinked for posterity). Of course you may be completely happy with your current solution, there's really nothing wrong with it (apart from requiring an additional download). It's less worrisome than executing code of uncertain providence, but you could give it a shot anyway. What's life without a little experimentation?   AppleScript has built-in support for scripting key presses so I had assumed that if you didn't like the system shortcut then you could have written an AppleScript to press those keys for you (with an accompanying workflow to tie the script to a key combo of your choice), but it seems that the eject key is not scriptable.
  20. Like
    Subject22 reacted to Carlos-Sz in To Dropbox 3.0 (formerly Move to Dropbox) + URL to the clipboard   
    Great! I’ll see if I can add just link to the clipboard if the file is from Dropbox Public folder (source = destination).
  21. Like
    Subject22 got a reaction from liatmgat in Show/hide file extensions   
    A quick little workflow for showing and hiding file extensions. The workflow works as a file action (one action for showing and one for hiding extensions) and as a keyboard shortcut (for toggling the visibility of the file extensions of the items selected in OS X). 
     

    Download: Show/Hide File Extensions
  22. Like
    Subject22 got a reaction from mrwayne in Open current Safari tab in Chrome - Improved   
    Thanks for that Jude! I've gone ahead and modified the script myself anyway (you can re-download it from the same link in the first post). The new version tidies up that annoying extra "blank" tab in addition to working when Chrome doesn't have a window open. If someone could confirm that everything works now that'd be great :-)
  23. Like
    Subject22 reacted to Teodin in Wikipedia Auto Complete Workflow (Python)   
    Just look here: http://www.alfredforum.com/topic/1005-wikipedia-workflow-alternate/
  24. Like
    Subject22 reacted to designandsuch in Workflow: Units - convert currency length temperature weight and more   
    A better unit converter
     

     
     
     Download V0.6
    contact thijs@designandsuch.com for questions, bugs, ideas and such
     
    try out the demo
     
     
     
     
    There are more unit converters available. but i didn't like the lack of speed due to the feeds. Thus i redid one myself which calculates everything on your mac. It fetches new currency data once in a while.. that's the only time when a second delay might appear. And in my humble opinion it's already better than all other unit converters around.
     
    I might add more units in the future but so far it has:
     
    - 7 units temperature  ( celsius, kelvin, fahrenheit etc. )
    - 21 units on length  ( km, miles, nautical miles etc. )
    - 15 units on weight   ( kg, lb, etc. )
    - 8 units on time ( days, hours, years months etc )
    - 18 units on digital memory ( GB, MB TB bytes, kilobytes etc )
    - 5 units on speed ( km/h, miles per hour etc.
    - 90 units on currencies ( euro, dollar, pounds, dinar etc. )
     
    that's 164 units
     
     
    It has a nice blind rating system. so the more you choose for one answer, the more it will be likely that that one shows up in the suggestions.  
    Automatic updates from a currency xml file  
    I am working on an automatic update on the whole workflow so i could add new features while you use it. But that is not finished yet.. and i thought.. let's start sharing maybe ill get some nice feedback for possible cool ideas.  
    * designed the icons myself, probably could work some more on those too.  
     
     
    it doesn't need explanation...
    if you'll just start typing
    "5 kilometer to miles..."
    or something you will figure out how it works.
     
    some screenshots:
     
     
     
     
  25. Like
    Subject22 got a reaction from Jude in Open current Safari tab in Chrome - Improved   
    Thanks for that Jude! I've gone ahead and modified the script myself anyway (you can re-download it from the same link in the first post). The new version tidies up that annoying extra "blank" tab in addition to working when Chrome doesn't have a window open. If someone could confirm that everything works now that'd be great :-)
×
×
  • Create New...