Jump to content

GuiB

Member
  • Posts

    366
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by GuiB

  1. @deanishe, you're right! Then, @CincyTriGuy, you have the option to choose the way that better work for you
  2. I don't have Outlook installed on my computer at the moment since I'm not using it, but there should be an Applescript dictionary that you could have a look to create a Workflow for your specific use. However, if you don't want to go this way, you should be able to get to pretty much near what you are after with the default Alfred 'Email' action and a text expansion snippet (so in 2 actions instead of 1) First, make sure Outlook is set as the default email application: Open Mail.app and go into the preferences and set Outlook as the default email application if it's not already set. Then create a snippet workflow that populate the different fields in your email. See here for an example: https://nofile.io/f/65Xk9G2ppu4/Example-TextExpansionWithKeypress.alfredworkflow (I did it blindly from your description, so you may need to changed some of the Tab keypresses and maybe change some of the delay object to better suit your system) Then, select the file(s) that you want to send in your email in Finder and activate Alfred Action Window with your defined hotkey and select 'Email' in the action list. This should pop Outlook with a new email and with the selected files as attachment. Put your cursor in the first field that you are writing into with your snippet (the CC field in this case) and write your defined snippet expansion keyword Again, I did it blindly and don't know if everything works for Outlook, but this should give you a good idea
  3. Just use a List Filter input object. In the Keyword section write the one that you want to access the workflow (ex: 'template'). After that, use the '+' icon to add as many items that you want (write a name that specify what is the item and subtitle if you want to add more info, set the path to your file in the 'arg' section) and connect the object to an Open File object (thought it easier to do it than to write it ): https://nofile.io/f/MdT7R0YMXhd/Example-Word-Templates.alfredworkflow Just change the title and path in the listed items
  4. At the moment, when setting a Script Filter to let Alfred filter the results, Alfred blocks the rerun from running the script again and again when the user begins to write a query to filter. This is great to keep the filtering study (the list doesn't change while typing), but this prevents the rerun feature to do what it is made (update the list from time to time). So, I think it would be great to allow the rerun to be made even if we are filtering the result in Alfred (at the moment I'm doing the filtering inside the script instead of Alfred so it keeps running on and on). Maybe it would be great to have an option in the new menu that we can access from the cog next to the "Alfred Filters Results" checkbox ? Now that new filtering algorithms are being added to this Alfred filtering feature, I'm planning on letting Alfred filter the results as much as possible, but this is one thing that prevents me from using it
  5. I've updated my script above to pass multiple files to the new Alfred action command (now that it is possible with the new beta version: Build 867)
  6. Not exactly a bug and this is very low priority as this doesn't interfere with the application itself, but I'm not sure this is wanted... With the new build (Alfred 3.5 Pre-Release Build 867) a new debug warning is introduced when rerun is not in the range 0.1 to 5. Which is great, however, now every Script Filters that doesn't have 'rerun' set is getting a Warning ('[WARNING: input.scriptfilter] Script rerun of 0.00 is out of range (0.1s to 5s), rerun will be ignored') and I think this give more noises in the output (when we try to debug a workflow) then it should when the 'rerun' feature is not even used for the workflow. Is there a way to silence this warning when we don't change the default value of 'rerun' ?
  7. @deanishe I get your concern and updated my script above. However, this made me realize that Alfred commands resolve symlinks and aliases. So, @Andrew this would be something to have a look and I think is more a concern for the new 'action' command since this make the File Action pop the real file instead of the symbolic link or alias. --- Just keeping the rest of this post to give more info on the subject (basically, to let you know that the file name is not always set to the selected file), but @Andrew posted while I was writing and things should be fine with the update that you mention above For, example: Action command: When activating the File Action using a hotkey in Finder: When selecting a file: we get the file in the file action window with the title set to the file name and the path to the file (that's fine) When selecting an alias: we get the alias in the file action window with the title set to the alias file name and path to the alias file (fine) When selecting a symbolic link: we get the symbolic link file in the file action window with title set to the real file name, but path is the symbolic link path (so not as the others for the name, but this is fine since we work on the symbolic link path) When activating the File Action using the new Action command: We always get the real file path (name is set to the real file name and the path is set to the real file path even if we use the command with a path that is a symbolic link or alias)
  8. @Andrew thanks for those new commands! This help to speed things up and reduce workarounds! As for the "action" command, would it be possible to accept list of file paths (ex: 'tell application "Alfred 3" to action { "/path/to/file1", "/path/to/file2" }') so it would pops the Alfred File Action window like if we made multiple file selection in the Finder so we can act on all of them with the same action ? I think this would make the command more feature complete For everyone, here is my updated Bash Profile in case this is helpful to someone: # Alfred Search Function alfs() { if [ $# -eq 0 ]; then # If nothing is put as arguments open Alfred at the working directory so it list the content osascript -e "tell application \"Alfred 3\" to browse \"$(pwd)\"" elif [ $# -eq 1 ]; then # If only one argument is set if [[ -d $1 ]] || [[ -f $1 ]]; then # if it looks like a path or file, then make sure we send a full path to Alfred osascript -e "tell application \"Alfred 3\" to browse \"$(realpath -s "$1")\"" else # Any other words that are not a path would be sent to Alfred as is (ex: alfs snip -> would open Alfred with "snip") osascript -e "tell application \"Alfred 3\" to search \"$*\"" fi else # If multiple arguments are set, then they are sent to Alfred as is. (ex: alfs define allo -> would pop Alfred with "define allo") osascript -e "tell application \"Alfred 3\" to search \"$*\"" fi } # Alfred Action Function (pop the Alfred Action Window) alfa() { if [ $# -eq 0 ]; then # If no arguments, pop Alfred Action Window in the working directory osascript -e "tell application \"Alfred 3\" to action \"$(pwd)\"" else args="" argsAreAllPaths=true for arg in "$@" ; do filePath=$(realpath -s "$arg") if [[ -d $filePath ]] || [[ -f $filePath ]]; then # if the arg is a file of folder, append the path to the args string to build a list for the osascript command args+="\"$filePath\"," else argsAreAllPaths=false # if one argument is not a folder or file path, then pop Alfred with the standard search and try to access Alfred Action Window. This also makes it clear there's a problem with one of the passed paths break fi done if [ "$argsAreAllPaths" = true ] ; then # If all arguments are files or directories, open Alfred Action Window with the list args=${args%?} # remove the trailing comma osascript -e "tell application \"Alfred 3\" to action { $args }" else # If not all arguments are files or directories, search as is and try to access the Alfred Action Window. The Action Window should pop if it's possible, or the standard Alfred Search would be shown (ex: alfa activity monitor -> Would open the file action window of the Activity Monitor) actionKey="keystroke (ASCII character 29)" # (meaning: right arrow) Put your prefered action key (Alfred -> File Search -> Actions -> Show Actions) as applescript command for keystroke or key code (ex: "key code 98") delayBetweenEvents=0.1 # Play with the number if the action doesn't work correctly osascript -e "tell application \"Alfred 3\" to search \"$*\"" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to $actionKey" fi fi }
  9. Yep, after some testing, it seems to be working great! Thanks again @Andrew for all your work!
  10. Yes, things seems to work great after some testing by configuring the File Filter object using the JSON object before! Again, thanks @Andrew!
  11. Thanks @Andrew! Yes, after some testing, this seems to be working great now!
  12. Great! I'm glad I was helpful! I read again your Text Expander snippet string and the one you use in Alfred doesn't expand to the same string... Is it wanted ? If not, I think this snippet better produce your desired expansion: {date:EEE MMM d 'at' h:mm a}
  13. I just thought that I would add a note to my post above since I think I badly named the workflow... so please note that the script above doesn't only works for image file but could be used to copy any file to the clipboard
  14. Like that ? {date:EEE dd MMM 'at' HH:mm} Here is some reference if you want to experiment... http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns (more info within Alfred and where this link as been taken from: https://www.alfredapp.com/help/features/clipboard/dynamic-placeholders/#date-time)
  15. I've been using an applescript to copy files, so here is a version for your purpose that copy an image file and paste it to your front application. Since you said this is for an email I thought this was for an email signature, so I added an example for that using the snippet trigger (the hotkey one is set as well, but actually, any trigger could work...) Link to the workflow: https://nofile.io/f/UpBdhu7mcuP/ImagePaste.alfredworkflow For those that want to see the script directly, here is the main script to copy the file to the clipboard (just put this in a Run Script set to Applescript), the rest is just a simple cmd+v key combo for the pasting. on run (argv) set filePath to "/path/to/your/file" set the clipboard to POSIX file (POSIX path of ((POSIX file (filePath)) as alias)) end run Hope this helps!
  16. Ok, then I don't know if it's possible to connect something or not to an "Open URL" object in Alfred 2, but you should be able to connect the other objects in parallel to the "Open URL" so they will be activated at the same time. Again, a delay should help Sorry, I don't have Alfred 2 installed at the moment, but here are some screenshots that would show you what I mean. Also, I don't think there was a delay object in Alfred 2, so you should be better with a "Run Script" set to the applescript language and that would do the delay and the keypress... Like that: tell application "System Events" delay 0.3 keystroke "l" & return end tell Look at my last example in the screenshot to see how to connect them if you can't connect them one after the other
  17. Connect two "Dispatch Key Combo" after your "Open URL" object. One that press the "l" and the other that press "enter". I don't know what you are trying to do, but if you want to open an url and then do those key press, then you may need to wait that the URL is opened before doing the key press... If so, you may need to insert a "Delay" object to wait a little before making the key press.
  18. Ah ok, I think I understand, I thought you were talking that this would change the behaviour of the selected item (not getting the same selection), but you mean this is changing the behaviour of Alfred hiding itself (the window would stay there). Then do what you think is best for you and the application. For sure, I wouldn't want a regression that would give you more support work, so I'm fine with having Alfred flicker. Or what about adding an option to the hotkey object to specify if we want Alfred to hide or not ? Then you could keep it to hide by default and if we know that we want to keep Alfred focus, we would just have to change this option (or if not set and want to keep Alfred, then we would just see it flicker as it is). So, this shouldn't break any workflow.
  19. That would be great to make it works so Alfred doesn't flicker About your regression... but if Alfred is in front, wouldn't the macOS selection be always the one that is set in Alfred ? I mean, for example, if I have a file selected in Finder and pop Alfred to do something and do a hotkey to run the action. If I set the hotkey to get the selection from macOS and make the hotkey as global (no specific focus), then I would get the item in Alfred that has the selection even if Finder is just behind. I mean, if someone want a hotkey that works with the macOS selection, but want Alfred to hide when triggered, then why would it shows Alfred first? It just needs to trigger the hotkey on the specific application without showing Alfred first Or I just don't get what you said ?
  20. You said you got it, but I thought I would give an example in case someone is looking for a solution for that as well So here is a workflow that delay a notification based on the value (in minutes) that the user input : https://nofile.io/f/6umtyKnwZNw/Custom+Delay.alfredworkflow
  21. @Andrew, then I guess we both mis-read each other I thought you understood me and said that hotkeys that are assigned to Alfred focus could get some unpredicted behaviour since macOS window focus identification is weird with floating panel window... But yes, I want everything to happen inside Alfred (the selection is the selected item in Alfred). Look at my last action in the Workflow to have a better understanding of what I'm doing, but I just want to create shortcuts to an action that works on the selected file in Alfred (ex: create a symbolic link of the selected folder, or create a new file or folder...) I thought this was maybe just a matter of making sure the "Browse in Alfred" always put the focus to Alfred, but I know sometimes it could be more complicated than what we think. So that's why I didn't want to push too much this bug report, but if it's an easy fix then sure this would be appreciated if you can easily fix it at a point
  22. @Andrew, yes I know this is maybe unusual, but I thought I would let you know in case you find a quick and easy fix. However, yes, don't put this as high priority as there's workarounds to make it works nevertheless and I don't think a lot of people do things like that and just use File Actions instead, but I find it quite great to have some shortcuts like that to work with file rapidly. Thanks again for all your support!
  23. The behaviour is quite strange when activating an action with a hotkey that use the selection in macOS and is active when Alfred is in focus... I want to create some actions that work with files when browsing in Alfred using the builtin browser and that are triggered by a hotkey. However, it seems that Alfred doesn't always restore the focused application correctly when the action goes back to Alfred using the "Browse in Alfred" object since the hotkey doesn't always work the second time. Here is a workflow to easily test what I'm describing with different situations that work or not: https://nofile.io/f/AZCX1X9vo6m/HotKey+Issue+In+Alfred.alfredworkflow In short, it always work when I specify to activate Alfred with an applescript or (strangely) when the action trigger a "Run Script" with Applescript / Python / Ruby / PHP / Javascript as language, but not with Bash / Perl / ZSH or by sending the path to browse using the "Arg and Vars" object...
×
×
  • Create New...