Jump to content

Subject22

Member
  • Content Count

    167
  • Joined

  • Last visited

  • Days Won

    9

Reputation Activity

  1. 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: Open in Chrome
    Keywords: openinchrome, openinsafari
  2. Like
    Subject22 reacted to liatmgat in Show/hide file extensions   
    Thank you!!!
    Best workflow ever! I really appreciate it.
     
    You might want to edit the title of the main post to "Show/Hide file extensions" instead of "Share/hide" because that's a little confusing. I skipped over it when I searched for something like this the first time.
     
    Anyway, thanks a million for posting this workflow.
     
     
  3. 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
  4. Like
    Subject22 reacted to Andrew in App will not open on iOS 9 beta 4   
    Now that Alfred's new website is out, and Alfred Remote update is going to be my next priority
  5. Like
    Subject22 reacted to rice.shawn in Applescript doesn't function properly when called from Bash   
    Well, `osadecompile` doesn't help because it gives you the exact text that you typed in (I was curious if it would). What's hilarious is that this code works:
    osascript -e "$(osadecompile test2.scpt)" But, of course, that's just dumb.
     
    But, the source of the problem is that, when compiled, "state" is not returned as a string (even though you request it as one).
     
    When I try this code:
    #!/usr/bin/osascript tell application "iTunes" set state to (get player state as string) as string if state is "playing" then do shell script "echo is playing: " & state pause else do shell script "echo not playing: " & state end if end tell Then, when playing, I get "not playing: «constant ****kPSP»", and when it is not playing, I get "not playing: «constant ****kPSp»". So, the difference is the big v little p at the end of the constant, but the problem is that it is a constant and not a string.
     
    The actual fix is the following:
    if application "iTunes" is running then tell application "iTunes" if player state is playing then pause end tell end if In other words, if you don't try to make it into a string, then it just works. (Both from the command line and from the script editor).
  6. Like
    Subject22 got a reaction from milan in Toggle Hidden Files workflow   
    I made a similar workflow a while back and managed to bolt together a script filter which lets Alfred tell you if hidden files are currently visible or if they're hidden. This may or may not be useful to you
    #!/bin/sh #check the current value and display the result as subtitle CURVALUE=$(defaults read com.apple.finder AppleShowAllFiles -bool) if [ $CURVALUE = 0 ]; then subtitle="Hidden files are currently invisible" else subtitle="Hidden files are currently visible" fi echo '<?xml version="1.0"?><items>' echo "<item arg=\"{query}\" uid=\"ssid\" valid=\"yes\">" echo "<title>Toggle hidden files</title>" echo "<subtitle>$subtitle</subtitle>" echo "<icon>icon.png</icon></item></items>" echo "</items>"
  7. Like
    Subject22 reacted to RodgerWW in Yosemite Dark Mode Toggle (With Alfred Theme Toggle)   
    DOWNLOAD: Yosemite GUI Mode Toggle Workflow
     
    With either a shortcut or hotkey you can toggle between normal and dark mode in Yosemite AND thanks to the recent Alfred update, the Alfred Theme!
     
    To make the workflow universal this switches between the Yosemite themes included with Alfred 2.
     
    To change to your own "Normal" and "Dark" Alfred themes, be sure to modify the script lines accordingly:
     
    For Normal Mode change the name:
    tell application "Alfred 2" to set theme "OS X Yosemite" For Dark Mode change the name:
    tell application "Alfred 2" to set theme "OS X Yosemite Dark"
  8. Like
    Subject22 reacted to ngreenstein in Kill Process Workflow   
    I made a workflow to kill processes quickly.
     
    You can grab it (and read more about it) on GitHub.
    Direct download link.
     
    Here are some highlights:
    Autocompletes process names Learns and prioritizes processes you kill frequently Shows icons when possible Shows CPU usage Shows process paths Ignores case Screenshot:

    Enjoy, and feel free to share any feedback you have.
  9. Like
    Subject22 reacted to rice.shawn in Applescript doesn't function properly when called from Bash   
    It works just fine for me from bash.
     
    All I did was copy/paste the snippet in the OP into a file called test.scpt. I opened iTunes, pressed play on the first track (which, apparently is a Ke$ha track... don't ask). Then, in iTerm I entered the command `osacript test.scpt`, and iTunes paused just fine.
     
    But, let's get a bit more specific. To create the script, I did `nano test.scpt` from in iTerm and copy/pasted there.
     
    As a curiosity, I tried it again by saving it through Script Editor as `test2.scpt`. The script would work correctly when run from Script Editor, but it wouldn't work via the Bash command. So I can reproduce your problem that way.
     
    So there has to be a problem with the way that Script Editor is saving that particular script. When I `cat test.scpt`, then I see the script. When I `cat test2.scpt`, then I get the binary version of the script (garbled text). The size difference is 
    staff 1952 Mar 4 11:45 test2.scpt staff 163 Mar 4 11:35 test.scpt So, 163 bytes vs 2kb. Weird, right?
     
    So, I propose a work around: save the script as plain text rather than as a compiled binary script file. While the latter should work, something is making it not work.
  10. Like
    Subject22 reacted to RodgerWW in Applescript doesn't function properly when called from Bash   
    I did actually test your method using a scrpt file from terminal and you are NOT crazy!
  11. Like
    Subject22 reacted to designandsuch in Workflow: Units - convert currency length temperature weight and more   
    Thanks a lot, I must say that I have no knowledge on this topic whatsoever, but I will definitely look into it. It seems like one of those topics you should have at least a basic understanding of. So I will defs look into it, and I will notify you when i incorporate it into the workflow
     
    +1 for the link
  12. Like
    Subject22 reacted to deanishe in Searchio! Auto-suggestion from search engines in different languages   
    Not until I've figured out if and how Alfred's killing scripts messes with Alfred-Workflow's caching code. I don't want the workflow generating loads of invalid query cache files because Alfred is killing the process in the middle of a cache write.
     
    It's simple enough to wrap critical code so that signals are ignored till the code completes, but there's other stuff much higher up the TODO list.
  13. Like
    Subject22 reacted to Andrew in Sending Keyboard Modifiers (Ctrl etc.)   
    I'm definitely going to provide a way to more easily dispatch specific key commands and combos to OS X in a future release of Alfred... this seems really popular
  14. Like
    Subject22 reacted to rice.shawn in System Controls dialog box   
    Alfred Remote is more like a sidekick than a remote in the sense that you're thinking of. It gives you easier access to a lot of things while you're at your computer.
     
    You can make it more of a remote in the sense that you're thinking of, but you need to write workflows that will handle each part of the operation.
  15. Like
    Subject22 reacted to flogehring in Issue: Tab contrast   
    Hi,
     
    I'm really happy Alfred remote is here and I'm looking forward to configuring it to my needs
     
    I found the contrast of the background of the tabs/pages at the bottom way too low. I do now understand how the interface is supposed to work but I think that I won't be the only one who will have trouble with figuring that out. A slight color adjustment might already save the day
     
    Also the icon isn't the most attractive on my homescreen…
     
    I don't mean to be a naysayer, I'm really excited about this app and a huge Alfred fan. This is just one "easy to fix" issue that I stumbled upon right away.
     
    Keep up the great work
     
    Flo
  16. Like
    Subject22 reacted to Andrew in Connecting to Mac outside of LAN?   
    You can setup Alfred Remote to connect directly to an IP (the "Direct" option when adding a new Alfred)... if you have port forwarding setup on your router, connecting to Alfred from outside your LAN is possible
  17. Like
    Subject22 reacted to dfay in Sending Keyboard Modifiers (Ctrl etc.)   
    A lot of Alfred workflows and commands have options when certain keys are pressed.  These keystrokes can be sent from Alfred Remote with a bit of Applescript.  e.g. to hold and release the Control key, add the following:
     
    Alfred Preferences > Remote > System Commands (or wherever you want on your remote) > + > Run Script > language: /usr/bin/osascript
      then paste in the following short Applescript: tell application "System Events" control key down end tell Name this item "Hold Ctrl" but BEFORE YOU TEST IT add a second command following the same procedure:
    tell application "System Events" control key up end tell Name this 2nd item "Release Ctrl".
     
    Now you can test it and make sure it works.  If you test the first script before adding the second, you will end up with a practically unusable computer b/c the Control key will be down and you will have no way to release it.  I found this out the hard way and had to reboot.
     
    IMPORTANT - this does not work with the Option key for reasons that are unclear.  You can create an Applescript to hold the Option key down, and it will work, but the corresponding script to release does not work, and you'll be forced to reboot to get your keyboard working normally again.
  18. Like
    Subject22 reacted to dfay in Sending Keyboard Modifiers (Ctrl etc.)   
    You'll have a much easier time debugging if you write the scripts in Script Editor, verify that they work there, and then move them into Alfred.
  19. Like
    Subject22 reacted to Ender in Toggle Do Not Disturb (w/ Yosemite Support)   
    Toggle Do Not Disturb
     
    The AppleScript used in the workflow posted here stopped working in Yosemite.  
    I found a new AppleScript (on github) and updated the workflow accordingly.
     
    Download Workflow
  20. Like
    Subject22 reacted to Ender in Toggle Do Not Disturb   
    Done.
  21. Like
    Subject22 got a reaction from alanmoo in Toggle Do Not Disturb   
    This is broken in the Yosemite public beta (probably do to some menu bar reorganisation?) Anyway, I tinkered a bit but couldn't fix it. The best I came up with was this Applescript: 
    tell application "System Events" tell process "SystemUIServer" try key down option click menu bar item 1 of menu bar 2 key up option on error key up option end try end tell end tell Note the use of the try block. In the current version of the workflow the option key gets stuck pressed down, preventing you from typing normal characters until you restart System Events (or reboot your Mac).
     
    I can see the script above clicking the Notification Centre icon, because the icon flashes blue when I run it. It doesn't actually toggle Do Not Disturb though.
  22. Like
    Subject22 reacted to Jono in Alfred icon location   
    Look inside /Applications/Alfred 2.app/Contents/Frameworks/Alfred Framework.framework/Versions/A/Resources
  23. 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.
  24. 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…
  25. Like
    Subject22 got a reaction from milopus 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: Open in Chrome
    Keywords: openinchrome, openinsafari
×
×
  • Create New...