Jump to content

deanishe

Community Hero
  • Content Count

    7,784
  • Joined

  • Last visited

  • Days Won

    468

Everything posted by deanishe

  1. The Typinator forum would be a more suitable place for that question, tbh. Typinator uses can probably tell you more about importing things into Typinator than Alfred users can.
  2. Showing a notification is the only one I'm aware of. Run NSAppleScript shows Alfred's icon, while Run Script shows an ugly "binary executable" one.
  3. Making dates with ordinal numbers is fairly straightforward to do. I can't help until somebody explains what's supposed to happen with them, though. You can't just add a new placeholder macro to Alfred, so you need to describe what kinds of ordinal dates you need to put where and how. If you just want a snippet that inserts the current date with an ordinal for the day, that's easy.
  4. AppleScript is fine for making applications do things. You don't have many options, and AppleScript is the "native" one, so often the best choice. The reason it isn’t working is because of Run NSAppleScript. Workflow variables aren’t available in Run NSAppleScript because the script is run in Alfred’s own process, not a separate one with its own environment Alfred can set variables in. If you move your code to a Run Script Action with Language = /usr/bin/osascript (AS), it should work. Note: You also need to change the function signature. Run Script uses on run argv, not on alfred_
  5. No, unfortunately it's not. If there's no actual search page, you can't make a link to it. OTOH, you can often use the same API as the embedded JavaScript search widget and show the results directly in Alfred if you are willing to write a workflow. Here's a workflow that shows material-ui.com search results in Alfred.
  6. Then you've done something wrong. And you should almost always use "with input as argv", anyway. It works much better. Nothing else. ARGV is where command-line arguments are stored. That's just how UNIX programs work. It's not mentioned in Alfred's documentation because it's a topic for your programming language's docs.
  7. Firefox doesn't support pasting rich text. Please report your issue to Mozilla.
  8. Then you should be able to ask for the OTP with Alfred, then execute your commands on the remote server via a shell script (Run Script action with Language = /bin/zsh). You can use sshpass (install via Homebrew with brew install hudochenkov/sshpass/sshpass). Something like: otp="$1" /usr/local/bin/sshpass -p "$otp" ssh user@jumphost.domain.com /bin/sh -c 'command 1; command 2'
  9. What do you mean "a local Twitter client"? Getting the list of people you follow is the hard part. A List Filter sounds a bit silly. Unless you're creating the list of people you follow manually (which sounds unpleasant), then you won't want to be editing the workflow, either. It should be a Script Filter.
  10. You misunderstand how Alfred works. There is only one argument to your script, $argv[1], which contains everything the user entered. You’re using $argv[2] etc., which don’t exist. You also can’t just echo a result from a Script Filter. You must output JSON in the format expected by Alfred. Try this code instead: <?php $gross = $argv[1]; // user input $pct = 0.029; $flat = 0.3; $sum = $gross * $pct + $flat; // Alfred feedback JSON $item = array('title' => "$sum", 'arg' => "$sum"); $json = json_encode(array('items' => array($item))); echo $json; // send
  11. Trying to simulate the way a user would do something isn't usually a good approach to automation. Programs have APIs to talk to each other. Always the same commands? Which of the steps you describe cannot be fully automated because they're actually different each time, and which are just things you're doing because that's the way you do it?
  12. What happens when you choose "Save As…" with File Format = PDF? Make sure "best for electronic distribution and accessibility" is selected.
  13. Yes, it is. Sorry, I assumed you were running ssh from a Run Script action, not a Terminal Command because that's fundamentally unsuited for "talking" to a process like you're trying to do (enter the password). No, that's not what's happening. Terminal Command is functionally similar to Open URL or Open Files. It just takes whatever command you give it and tells your terminal emulator (Terminal.app, iTerm etc.) to run it in a new tab. It has no idea what happens after that. It can't send anything else to the terminal, nor does it get any response.
  14. I've seen some issues with Alfred being unresponsive. In my case, I'm pretty sure it's when disk IO is bogging down and backed up. I don't recall Alfred ever being the only app that was affected. If Alfred isn't responding, chances are a bunch of my other apps aren't, either.
  15. Does Spotlight find things on the volume? (Alfred uses the same search index as Spotlight.)
  16. ssh (and most other programs) only ask for a password if they're connected to a terminal (i.e. an interactive session). If they're not, they exit with an error. That's almost certainly what's happening with your script. You can try using sshpass or a pty library to create the pseudoterminal ssh is expecting.
  17. Here's a demonstration workflow that reconfigures a File Filter's scope by editing info.plist. Keyword dynsearch is the main “search” File Filter, and keyword dynset lets you change the scope of the main File Filter. Instead of storing a workflow/environment variable, it edits the File Filter config in info.plist, so you don’t need the extra Keyword and JSON Config. As the File Filter’s UID is hard-coded in the script (dynamic.py), you have to be careful not to delete the main File Filter (or to update the script with the new UID if you do).
  18. Pretty much, yeah. A JSON Config is the only official way to dynamically-configure a File Search's scope. Unofficially, you could add a second File Filter to configure the search scope (instead of setting a workflow variable), and edit the File Filter’s scope directly in info.plist.
  19. This workflow exports Word file(s) to PDFs and opens the PDFs in another application. Word’s built-in PDF function actually uploads the Word doc to Microsoft to be converted online. My workflow can do that (see USE_ONLINE_SERVICE in the configuration), but by default it uses macOS’s built-in ability to save a PDF file from the Print dialog. Scripting the Print dialog is clunky and slow, but doesn't have the obvious privacy concerns of uploading your Word docs to Microsoft. It should also be faster for very large documents. There's also a setting to tell the
  20. Hi @thartley, welcome to the forum. Alfred can help you find a file or open it in a specific app, but it can't help you convert files to different formats. Do you have Microsoft Word installed?
  21. You can't set the variable and then use it in the same element. You need two Arg & Vars: one to set the variable to your date string, another to lowercase the variable. It works for me.
  22. It doesn’t work with dates, only with clipboard and variables. Looks like you'll need to set a variable to your date placeholder, then apply the lowercase transform separately.
×
×
  • Create New...