Jump to content

deanishe

Community Hero
  • Content Count

    4,904
  • Joined

  • Last visited

  • Days Won

    285

Everything posted by deanishe

  1. deanishe

    Open url with multiple queries

    Also, is this "first number" optional? Should the workflow only work with a "first number" and "other numbers" or should it also work like the old one if you only paste a bunch of numbers from Excel without any special "first number"?
  2. deanishe

    Open url with multiple queries

    Not really. I need to know how to divvy up the input query into URLs. So you want your input split into "first number" and "other numbers". Then you want the workflow to open a URL for each of "other numbers" where each URL also includes "first number"?
  3. deanishe

    Is it possible to set multiple hotkeys?

    That's a bit more complicated than it need be. In the Hotkey, just change Action from "Pass through to workflow" to "Show Alfred". Job done. I think you do need to simulate a key combo to show the Clipboard Viewer, however.
  4. Use AppleScript's set size and set position commands.
  5. deanishe

    Open url with multiple queries

    I don't exactly follow you. You want to type 333, then paste a column of numbers from Excel into Alfred, and have the workflow open a URL for every number from Excel but with 333 added to each one?
  6. That's what's very fragile. Simulating mouse clicks is basically just blindly clicking a fixed location on the screen. It's up to you to make sure the right application is under the mouse, not under any other windows and in the right mode to begin with. And there's generally no way of telling whether or not it worked from your script.
  7. What you describe sounds like 95+% scripting, tbh, and doesn't really have a whole lot to do with Alfred. I mean, Alfred can launch your scripts via a keyword or a hotkey or even a snippet, but it doesn't provide any tools to help automate clicking buttons or playing playlists because Alfred's a launcher, not an automation toolbox. Unless all your apps have automation APIs, that sounds like it might be quite a fragile workflow and hard to get right.
  8. Yes, you're right. I'd misunderstood what you're script was doing.
  9. I think that's the wrong PID… By the looks of it, that's the parent script that launches the long-running, background one. You need to save the PID of the long-running, background process and check for it in the parent script. If the PID file doesn't exist or contains an invalid PID, the parent script starts the long-running background process. If you do it the normal way, the parent can write the new process's PID to the PID file. As you're asking Alfred to start the process for you, you can't get its PID, so the background script will have to save its own PID to the PID file. Also, because you're starting the background process asynchronously via Alfred, instead of waiting for it, it's possible Alfred will start running your Script Filter again before it starts the other one, leaving you with multiple copies of the background process running anyway.
  10. If you're launching your long-running script from the Script Filter script, you still have the problem of the script being run multiple times. Unless it's your own server the workflow hammers, you should probably still implement some kind of guard or lock to prevent multiple copies running at the same time. A PID file is just a file that a program creates at a known path when it's running and deletes when it exits. It's called a PID file because the program usually writes its PID to the file, so you can easily check if the program really is running (kill -0 <PID>) or has exited but failed to remove its PID file. Most of my workflows have Script Filters that launch longer-running background jobs to fetch data or check for updates. If you're interested this is the API I wrote for doing that, and here's the demo workflow showing how to use it.
  11. Right, so if 1 and 2 should start at the same time, either you Start both via another trigger (Hotkey, Snippet Trigger etc.), or Start script 2 from the same code as 1, being careful to properly background the process and make sure you're only running one copy of 2 at a time (e.g. using a PID file).
  12. Sure. You can create your own workflow and launch it either via a Hotkey or Alfred's File Actions. Use a Hotkey with Argument "Selection in macOS" and/or a File Action. Connect it/them to an "Open File" Action set to open the files in Photoshop.
  13. So what you want to do is: 1. Show something in Alfred, e.g. "fetching data..." 2. Go off to the web and fetch some data 3. Show those data in Alfred Is that right? This whole "concurrency" thing is just the way you think you should do that?
  14. No. Alfred will try to run the workflow for every single character the user enters (unless "Alfred filters results" is used). As for the concurrency issue: 1 and 2 cannot run concurrently because you've connected 2 downstream of 1. That means Alfred won't start 2 until 1 has finished running and the user actions a result. If you want to run two or more elements (Run Script and/or Script Filter) at the same time, they all have to be connected to the same trigger (Hotkey/Snippet Trigger/Keyword etc.) If you want to launch another process in the same script as a Script Filter—and you're not using "Alfred filters results"—you need to have logic in place to ensure it's only run once: as mentioned above, Alfred will typically execute a Script Filter several times as fast as it can, and you could easily end up with 5+ copies of the process running.
  15. deanishe

    URL won't open page query

    This site's interesting, as the search uses a JavaScript list of artists. So here's a workflow that directly searches the list of artists. Much better than an Alfred web search.
  16. deanishe

    URL won't open page query

    You have a typo in the URL. There's an extra apostrophe in the path: It's /'artist-, not /artist-. In any case, that's only going to work if you type the artist's name as lastname-firstname.
  17. deanishe

    Simulate arrow keystrokes

    No. One or the other. They do the same thing. Alfred won't let you create a Hotkey for that key, so you'll have to use a different app and the AppleScript if you want to bind to a numpad key without a modifier.
  18. What exactly are you trying to achieve? You can't have two scripts send results to a Script Filter, AFAIK. Also, Alfred is (or at least was) a bit finicky about what it considers a finished process. Your process must also close STDOUT and STDERR for Alfred to consider it done. So moving processes to the background with & isn't enough. You also have to redirect STDOUT and STDERR, so Alfred doesn't wait for it to complete.
  19. deanishe

    Folder Directory Workflow

    Workflow with a File Action to create a tree of directories.
  20. deanishe

    Add tasks in Tick Tick

    No. My post is pretty clear that {var:...} expansion doesn't work in Script boxes and also explains exactly how to read the variables from Python code.
  21. deanishe

    Folder Directory Workflow

    Store the incoming query (the directory path) in a variable, then use a Keyword to ask for the name of the parent directory. Now you can access both variables from your script.
  22. deanishe

    Folder Directory Workflow

    Yes, it is. If you want to use Alfred to pick the destination directory, you should implement it as a File Action, i.e. select a directory in Finder or Alfred (or most other apps), then you can run Alfred's File Actions on it and choose "Create New Folders…" (or whatever) to run your workflow. FWIW, mkdir has a -p option to create intermediate directories, and you can use {...} for multiple directories, so: mkdir -p "$1/$2/{INTV,TRACKING,MUX SFX,RAW TAPE,SELECTS}" mkdir -p "$1/$2/SESSIONS/{CHAP 1,CHAP 2, CHAP 3,CHAP 4,CHAP 5,STRINGOUTS}" should create all of your directories with less typing.
  23. deanishe

    Ability to search inside Snippet

    Got you. It might be easy, but that isn’t what snippets are for. They’re text expansions to insert into other apps, not a database of notes. It sounds like you want a workflow or an app designed for searching notes, like nvAlt.
  24. deanishe

    Add Custom Website Search Results

    Hi, @CodeCowboy, welcome to the forum. For my part, I don't really understand exactly what you're requesting. What query are you entering into Alfred? Where does the Stack Overflow URL come from? Where does the CSS selector come from? Where would the results come from? Are you suggesting Alfred retrieve webpages, parse them using CSS selectors and show the results?
  25. deanishe

    Ability to search inside Snippet

    Hi @braveheart1980, welcome to the forum. I'm not entirely clear on what you're doing. Why are you putting all 1250 existing snippets into one Alfred snippet? It sounds like you want to search through an already-pasted snippet. That isn't really possible from Alfred: once you've inserted a snippet, the text belongs to the app it was inserted in and other apps (like Alfred) can't just search through it. We use external tools to convert other snippet formats into Alfred's snippet format, so you can import them. AFAIK, there isn't such a tool for ShortKeys yet, but creating one sounds like the proper solution. A simpler way might be to put the snippets in a List Filter, which you can activate with a Snippet Trigger, then search for and paste the text you're looking for.
×