Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. How to run calculations in a workflow

    This is great, thanks a lot for your support!
  3. Yesterday
  4. Here it is: https://nofile.io/f/mPGnUHXWJVJ/Calculation+in+Workflow+Example.alfredworkflow About commenting, we can't round to decimal using the builtin Alfred calculator since it rounds to the nearest integer. So, the trick for the first version is to multiply the result by 100 so we move the 2 decimals out and then round the value and divide back by 100. round(({query}+({query}/0.971))*100)/100 For the second version, there's a builtin function in python to round a value and there's a second argument to specify the precision that we want, so 2 in this case Hope this helps!
  5. How to run calculations in a workflow

    Both of these options are really great! Thanks so much for this. Can you comment on how to modify each of these to round to 2 decimal points?
  6. I deliberately left the "shebang" comment as an exercise for the reader (I didn't want to get into the details of UNIX scripting). Now we've gone there, I guess we need to mention that Alfred runs your scripts in its own, empty environment, not your shell's.
  7. Here is 2 examples... If you don't want to do some scripting, the first example could be great to easily add a formula by modifying the "Arg and Vars" object (can duplicate to make more math functions). The second one is nicer if you prefer to have a direct feedback on the number you input https://nofile.io/f/vucR6c28GJq/Calculation+in+Workflow+Example.alfredworkflow Best!
  8. @deanishe Making this comment since you mentioned you wanted to make the post clear for newbies and link to it in the future. I’d expand a bit more on that. For example: “which is to say something you can run from a shell (the command-line interface that the Terminal app uses to run commands)”. I’d link to an explanation of what a shebang is.
  9. @Andrew That did not work for me. Slowed both settings all the way down, and whatever is on the clipboard before typing a Snippet Keyword is what's being pasted. Also, I verified that everything is working properly in all of the other Microsoft apps: I tested Word, Excel and PowerPoint with no issues. I'm an Office 365 user, so have the latest installations. Thanks for looking!
  10. Hi, I have a calculation I have to make a lot. {query}+({query}/0.971) How would I set this up in a workflow (so I can make calculations quicker than the normal calculator)? Thanks in advance!
  11. Yes, I went a little fast to the solutions Thanks for explaining everything
  12. @GuiB gave some solutions, but didn't explain what the root cause of the problem is. (Excuse me if this explanation comes across as for-idiots or patronising: I'm aiming to explain this just once and link to it in future, so I'm writing this for total noobs.) macOS is basically a UNIX system with Cool Apple Shit layered on top. Alfred itself exists in the Cool Apple Shit layer, but workflows are at the lower UNIX level. This means they must, essentially, be UNIX programs. As such, an External Script element can only run a UNIX executable, which is to say something you can run from a shell. Concretely, that means the execute bit must be set (run chmod +x /path/to/script in a shell), but also that it must be a UNIX program or a script with a shebang. AppleScript, as the name implies, belongs to the higher Cool Apple Shit layer (though AppleScript is pretty damn far from cool), and as a result you can't run it directly via the UNIX subsystem. Fortunately, Apple has written a bunch of programs to access the Cool Apple Shit from the underlying UNIX layer. As @GuiB explained, the one you need to run AppleScript scripts from the UNIX layer is osascript. But there are other super-cool ones, like security, which provides access to the macOS Keychain, and mdfind, which lets you run Spotlight queries from the command line/scripts/workflows.
  13. Hi! If you set the preference in Alfred to "Run AppleScripts instead of opening" (found in: "Alfred Preferences -> File Search -> Advanced -> AppleScripts [ ] Run AppleScripts instead of opening), then when you search and open an AppleScript file in Alfred then Alfred will run it directly. So, no need to create a script for that. Just use a Hotkey trigger connected to an Open File action (where you can directly drag and drop the AppleScript that you want to run). However, if you want to go with creating a script, then you would be better using a Bash script file that run the AppleScript file using the osascript command. Example: #!/bin/bash osascript path/to/your/applescript/file.scpt Also, before you'll be able to use it, you will need to make your Bash file executable using `chmod +x yourFile.sh` Or instead of creating a Bash file, just use a "Run Script" action in Alfred set to Language "/bin/bash" and with the osascript command inside "osascript path/to/you/applescript/file.scpt"
  14. Version: Alfred 3.4.1 I am new to Alfred and am running into a problem. I created an AppleScript to send information from Outlook 2016 to OmniFocus 2. I have it set to run an external script (makes it much easier for me to make changes and test). I created a hotkey to run the script. When I launch the script with the hotkey, I get this error: Unable to run task! Reason: launch path not accessible The external script may not exist, or does not have execute (+x) permissions. I have tried putting in the script folder for OmniFocus, Outlook and Alfred, but get the error each time. I am sure I a doing something simple wrong. Thanks in advance for your help!
  15. https://github.com/brunocbr/dtp-activeprojects-workflow This is an workflow for quickly finding and accessing group records on the root of an "Active Projects" DTP database. You have to change property pstrDatabaseName to match your database name on the Script Filter.
  16. @AriW Try slowing down the key events, as Alfred may be too quick for MS OneNote. You can do this in Alfred's Features > Snippets > [cog] > Tweaking preferences. Let me know how you get on Cheers, Andrew
  17. For some reason it won't work on Sierra (10.12.6). Both the keyboard and trackpad won't get locked.
  18. Working with latest version of Alfred (3.4.1 [860]) on MacOS Sierra 10.12.5, and using OneNote 15.37. iMac Retina 5K from late 2015. Snippets don't expand when entering a Keyword, instead it pastes the clipboard. Snippets do work when activating the Viewer and selecting one. Happy to record a short video of this bug if that would be helpful!
  19. Right, sorry. I figured you were talking about results from running as script, as Alfred always re-populates its own results instantly for me. That said, I don't use it as heavily as you, so perhaps I'm just not noticing the odd delay. I'd agree that caching the results along with the last query would be a good idea. Alfred should still perform the query again, imo, and update the results if something has changed. Same as happens with rerun in a Script Filter.
  20. Hi @deanishe I think my original post wasn't clear enough, and I will redact it, but the Ruby scripts I mention in my original post are not Alfred workflows. They are .rb files that I simply launch, by typing their file names in Alfred. My feature suggestion is about relaunching quickly & reliably the last launched file. This file could be .jpg, .txt or any other extension really; I was mentionning .rb just because it's my own use case.
  21. Airports

    Great workflow. Very useful - thanks!
  22. iOS keyboard text expansion

    Fantastic work!
  23. @HRD I'll be able to load the bookmarks manually in Alfred's next release. I'm going to lock this topic now as there is no need to continually bump it - I already have an internal ticket for this issue.
  24. @psicologo First, check which workflow version you're using. You can grab the latest one from the link @vitor provided, or from Github: https://github.com/surrealroad/alfred-reminders/releases/tag/v74 I don't believe @surrealroad is maintaining the Packal version any longer, so that thread is your best starting point. I'm using the latest version of the workflow and it seems to be working fine Cheers, Vero
  25. I don't think that's a good solution. It might work for some workflows, but with others, the results are effectively invalid as soon as a result is actioned or Alfred closed (e.g. a workflow that shows and/or does something with Safari tabs). As such, it would have to be a Script Filter-level option. Even then, it still might lead to unexpected behaviour, as Alfred doesn't have the context your script has to know whether the old results are still valid (e.g. the user has edited whichever data the workflow is using). IMO, your script is a better place for the result-caching to be performed. In a language like Ruby, it's pretty simple to implement a wrapper function that caches data for X seconds.
  26. Nice. I got Alfred just because of this functionality. Look forward to seeing what I can do with it. Thank you.
  1. Load more activity