Jump to content

vitor

Staff
  • Posts

    8,572
  • Joined

  • Last visited

  • Days Won

    715

Posts posted by vitor

  1. You can do it with Applescript (to run applescript inside your bash script, use osascript -e "<code here>").

    -- with this method
    -- if a Finder window is the frontmost window, it’ll return the path to it, else it’ll return the path to the desktop
    
    tell application "Finder" to set dirPath to (quoted form of POSIX path of (insertion location as alias))
    
    return dirPath
    
    -- with this method
    -- if there’s any Finder window open, it’ll return the path of the frontmost one, else it’ll return the path to the home directory
    
    try
    	tell application "Finder" to set dirPath to (POSIX path of (folder of the front window as alias))
    on error
    	set dirPath to (POSIX path of (path to home folder))
    end try
    
    return dirPath
    You can see this workflow for a working example.
  2. since such a specific app is not available for mac.

    Not sure what you mean by that, there are a bunch of them, both CLI and GUI. Some are even featured on known websites.

     

    btw, it sometimes takes time to show results and default callbacks are listed while it's searching, so just wait for the results. i did not look for the reason in specific, i m sure it s documented somewhere.

    When using a Script Filter, Alfred reruns your command with every character entered/removed/changed. Since it’s trying to output something (by reading the results XML over and over), it may be something there — some operation your workflow runs where it doesn’t output the correct code (or any at all), that confuses it in that moment.

  3. It is possible, yes (link available for 30 days), but not without its flaws. The issue is that since we don't know when the page finishes loading, it may do it after ⌘+f was pressed, which will hide the find box (although you can press the shortcut again, and it should reappear with your query).

    Change the url on first line of the Run Script to the one you want, and play with the delay amount on the second line, until you get something that works/is acceptable for you, your connection speed, and the website (until it seems to work fine with your specific case, basically).

     

    It’s a bit of a hack, since it relies on waiting times and sending key presses, but it should work.

  4. Great workflow. Would be very useful to me. But unfortunately I can't seem to get this to work on OSX Mavericks. Anything idea?

     

    One of the biggest challenges to make this workflow and its “sibling” work is that Alfred does not read your PATH and other things that your terminal does when starting. Different users also have different shells and configurations, which makes it harder to set this up in a way that works for everybody. This last update addresses those issues, in some form.

     

    Can you please tell me what is your default shell (bash, zsh, other), where it’s located (are you using /usr/bin/zsh/, or /usr/local/bin/zsh, for example), what command you’re trying to run that fails, and how did you install it (is it a system command, or did you get it from homebrew or some other means)? Basically, the more details, the better.

  5. When reporting issues, please include your exact installed versions of:

    • The Workflow.
    • Alfred.
    • macOS.

    In addition to:

    • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
    • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

    Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

  6. But I'm not sure this is possible in Chrome due to their lack of applescript support.

    What makes you think that? Its applescript support is pretty acceptable, and nothing to scoff at. It’s a lot better than a big percentage of apps out there, and certainly better than the majority of browsers, which range from having none to ridiculously deficient applescript support.

     

    It’s a genuine question, though, what makes you feel its applescript support is poor?

×
×
  • Create New...