Jump to content

GuiB

Member
  • Posts

    366
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by GuiB

  1. Great! Looking forward for the update ! Thanks for investigating the issue!
  2. Hi! Think of placeholders as just string ( {query} is replaced to a string containing the user input ), so there's no math operations that can take place. If you put an equation, then it won't be evaluated, but you would get back the full string. Therefore, if you want to modify a query, then you would need another Workflow Object that can manipulate the query to send a modified version to the next object. For your use case, you would need to make a script (using a "Run Script" or "Script Filter" depending on how you want to interact with your workflow). The script would multiply the input by 60 and send the result to the next object (the output of the script become the {query} of the next object)
  3. Hi! For your first question, I think it's because some of your files have the "hide extension" option ticked in the Get Info of the file and some don't. Look at one of your file that the extension is hidden and do CMD+i in the Finder to pop the Get Info window and look for the option to hide extension. Do the same with a file that shows the extension in Alfred and see if the option is set the same For your second option, your Search Scope must search in inside your VMware VM directory. Have a look inside Alfred's preferences under "Features -> Default Results -> Search Scope" and see if a listed directory is a parent of the files that you don't want to see
  4. Here is two solutions... one that is like the one from @vitor in the other post (calling a script filter for the output) and the other output the date directly in the Alfred popup (so a little more like the screenshot of @patrickmcd). So you can try both and choose the one you prefer https://nofile.io/f/R7CfN9no9yk/Quick+Glance.alfredworkflow I thought this could be a good idea, especially @vitor's one if you want multiple item at a glance when you activate Alfred... As for changing the date string, I would say like @vitor on the other post and look at the "date" command in the terminal (or here: https://ss64.com/bash/date.html)
  5. 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!
  6. 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!
  7. Yes, I went a little fast to the solutions Thanks for explaining everything
  8. 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"
  9. Great, thanks @deanishe for the tip! I didn't use this feature yet However, this help partially and seems to only work when not actioning with a modifier key (when this modifier key is set inside the script filter). I often use a modifier key when pressing Enter to navigate in my Workflow. But, as an example, here is a new version of the workflow with a script filter that looks a little more how I use it ('qlt4'), the normal actioning with just Enter works fine with your tip, however the flow still breaks when actioning with the 'shift' key. It seems to break since the 'shift' key action is specified inside the script filter and not outside like the 'alt' key (who is set outside and working also with your tip) Workflow: https://nofile.io/f/weodEKn3o2M/QL+Problem+When+Sending+to+Input+Objects.alfredworkflow
  10. There's a bug with Input Objects when arriving into one after having looked at a file using QuickLook in a Script Filter. Or maybe it's just the way the Script Filter is sending to the other objects... In short, when accessing a file using a script filter, everything works great if I don't press the shift key to have the quicklook popup to see the content of the file (the flow goes to the next object in the Workflow has it should). However, if I QuickLook the file, then after pressing enter to go to the next object in the Workflow, then I see Alfred reappear, but closes immediately. Also, with most objects this is happening when I change the {query} to an empty one using a "Arg and Vars" object, but the "Call External" sending into an "External" object to go into another input object, then just the sending break the flow. Here is a workflow to show you multiple situations. Again, it is not working just when you press 'shift' to have the QuickLook popup. If you try without showing the QuickLook, then everything works. https://nofile.io/f/ySkDQe6D1Cd/QL+Problem+When+Sending+to+Input+Objects.alfredworkflow Procedure to reproduce the bug: (it's the same procedure using 'qlt' or 'qlt2' or 'qlt3' -> the different keyword for the Script Filter) Pop Alfred (alt+space or your keyboard shortcut for it) Type the script filter keyword: qlt (You should now see a "Desktop" item in Alfred) Use QuickLook on the "Desktop" item (press: shift or cmd+y) Close the QuickLook popup (using 'shift' again or the escape key) Press Enter to go into the next object in the flow (the flow should break) Let me know if something isn't clear enough! I'm using this kind of flows to work with files, so I like having a look at some of the files when I navigate. Like always, thanks for your help P.S. I have tested sending to some other objects and this seemed to be fine; ex: post notification or LargeType object work fine, but may have missed some that didn't work. But it seems to be only when sending to an object that pop Alfred again [ Using Alfred 3.4.1 build 860 ]
  11. Just adding my +1 to allow the same hotkey in different Workflows. I understand that this wouldn't be wanted for global hotkeys (same hotkey in different workflows that work for any application), but it would be great to allow directly in the Workflow editor to set a hotkey with the same key configuration when both are restrained to different applications. Right now it's possible to do it by modifying the plist, but it would be easier and faster to do it directly in the Workflow editor. Or even better, it would be great to remove this restriction completely and do something like Keyboard Maestro where a list of actions could pop when multiple hotkey objects interferes... Well, in short, just adding my vote to improve this feature and make it easier I like having keyboard shortcuts, but this restriction makes it a little more limited in Alfred. Or, just giving an idea, what about showing a warning to the user when he is trying to set a hotkey that is already used (and maybe specifying which Workflow uses it or if it's a standard OS shortcuts) and asking him if he want to set it anyway...
  12. @Andrew I think you have ⌘⌃D (cmd+ctrl+d) excluded as well... I was trying to set it, but couldn't, I thought you excluded it since it's the standard shortcut for the popup dictionary. Or is it the OS that prevent us from using it ?
  13. Or maybe I'm not understanding the question clearly... you want an easy application switcher or an easy way to launch specific applications ? For the second, see my post above. If you want to have a list of opened application (as an alternative to CMD+Tab), try the "running-apps" workflow that you can find here: http://tedwise.com/2013/03/04/alfred-2-workflows/ Or direct download link: http://tedwi.se/u/dh
  14. Alfred doesn't differentiate the left or right command keys. However, you should be able to use another application that allow to map a specific key to an action (In this case, "Show Alfred on a right command key press". Have a look at Karabiner (disclaimer: I never used it, but seen people used it for this style of configuration). However, if you don't go this way, there's ways in Alfred that could help you speed things up... I mean, you could create a list of Hotkey to launch specific application (ex: ctrl+opt+t to launch TextEdit or ctrl+opt+s to launch Safari...). Or have one hotkey that pop a List Filter containing your most used applications so there would be less choices and therefore less chances of needed multiple character to select the right application. Or what about having a list of Hotkeys that are activated only in Alfred, so you pop Alfred and then press the Hotkey to the specific item that you want... Here is a workflow to show you my last idea... I thought this could be useful https://nofile.io/f/EqojqY3TaSs/Alfred+Launcher.alfredworkflow Just giving some ideas...
  15. Great @Andrew ! I'm glad my workflow was helpful! I think I remember having difficulties with some other fields from other objects, so this should be the same thing! Looking forward for the bug fix! Thanks again!
  16. Hi @nikivi, I think this do what you want... To search inside content of files you need to add a "kMDItemTextContent" in the Metadata Field of the File Filter object. I removed all the other fields so it only search inside the content. Download and try: https://nofile.io/f/rwPDejpTrB5/search+pdfs.alfredworkflow
  17. It's hard to determine since we can't see the code for you "alfred-edit-files" since it's binary and I can't see what this file is doing (what kind of item those it needs as input... file ? folder ? text ?)... However, I tried to send a file and the Alfred debugger complained about the JSON was missing expected keys: [2017-08-12 21:11:31][ERROR: input.scriptfilter] JSON is missing expected keys; items, variables or rerunafter: { "items": null } Maybe this is why it's not working on your side ? Also, I tried to send a file to the Open File object and it has worked. I'm just not sure why to try to set "{query} : {var:PATH}" inside the "Arg and Vars" object since the {query} would be what goes out of the object and, therefore, would be what you place on the bigger text field above
  18. @Andrew, like @johseb and @evanfuchs, I'm trying to dynamically specify a tag to search using a File Filter object, but it doesn't seem to work with an environment variable. The only dynamic variable that works is {query}... but I would like to set a tag using a variable and then to use the query to filter the list of files. It seems from some post above that this has worked before, but now it doesn't seem to work. I would say this is a bug ? or am I not setting things correctly ? Here is a workflow to show you using {query} as the dynamic field or using a {var:tagTitle} in the File Filter Metadata Field value or by configuring the File Filter using a JSON object. (only the first method with {query} works on my side) https://nofile.io/f/PJs0zmzpFdg/File+Filter+Dynamic+Tag+-+Test.alfredworkflow Using Alfred 3.4.1 Build 860 Thanks!
  19. Hi @nikivi, to add services to this menubar item you need to tick those that you want from the list of you first screen capture in your first post. However, the list would then depend on the context of when you want to execute a Service. For example, open TextEdit and don't select anything then look in the Menubar/Services section for the items that are listed. Then, do the same thing, but with text selected in the a text field. Then you should see other Services that relate to text. You should be able to send your selection to another application based on the Service that you activate. It's the same thing when you are in the Finder and you select a file or a folder, the list should change for services that can be run for files/folders... If this doesn't work, then maybe your application doesn't use standard GUI element or something else is not working correctly on your system... However, yes, this would be great to have this kind of Workflow that would always list all the Services and that could be activated at any time. Launchbar has this feature as well. The way it works is that it asks you for the item that the Services need before running, so it asks you for text or file/folder based on what the service want and then active the service with the item.
  20. Hi @nikivi, if I understand you clearly, you want the items in the Services Menu (App Menubar -> Services -> Active items there), so those that are active in the menubar based on your context (if you are in a text field or in the Finder...) ? And not a way to edit the "System Preferences->Keyboard->Shortcuts->Services Menu items" ? If so, I also wanted to have access to them and was using the Menu Bar Search workflow, but like the Key Clue workflow, it doesn't filter the list to only the active one and also doesn't always give them all... So, I had a look and found an easy way to get what we want. Here a workflow that give you a list of the items that are active in the Services Menu and that you can trigger https://nofile.io/f/TBcsjAai1o1/Services+Menu.alfredworkflow * I think I'll need to make a repository to put my workflows and scripts that I sent to this forum so they are easily found I don't think there's another Workflow that gives the active Services Menu Items in context, so for those who want more information about the idea: Basically, when we look in the Services Menu of the menubar programmatically, we get a list of all our Services instead of only those that are active. However, we can look at the attributes of the menu items and those that are not active doesn't have some attributes set like: Position (AXPosition) or Size (AXSize)... Therefore, we just have to filter the menu items so we only get those that have a position/size set. It's quite easy with Applescript and could be just that: tell application "System Events" tell (first process where it is frontmost) return name of every menu item of menu of menu item "Services" of menu 1 of menu bar item 2 of menu bar 1 whose item 1 of value of attribute "AXPosition" is not missing value end tell end tell but I went with JXA in the workflow so it's easier to build the JSON output for Alfred Hope this helps!
  21. @Andrew, I was about to send you a feature request about it, but thanks for going forward ! That would make it easier, faster and a lot more robust without the use of 'delay' between events!
  22. Hi @nikivi, nice idea about the 'pwd' and 'realpath' commands! I just had another look at my version so I have something set in my bash profile that is more complete. There's 2 functions. The first one is simpler as it mainly invoke Alfred as you would normally write in the Alfred popup, but by passing your arguments. It also tries to be smart with file path and working directory (thanks to your ideas). The second works more like the Alfred File Selection action when invoked with the hotkey on a Finder selection. Therefore, it shows directly the Action Window for files and folders and tries to do it as well for a query that is not a path (ex: alfa activity monitor -> Would open the file action window of the Activity Monitor). Like the first one, it tries to be smart with file path and working directory. A note to @nikivi, if you want to use my second function like yours, you should change the 'actionKey' to "key code 98" and the 'delayBetweenEvents' to 0.2 . Also, I think I found why your terminal sessions quits... I had an 'exit 1' in my previous script that shouldn't be there... it's now removed. So, here are the functions to put in you bash_profile or to use in a script file: # 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 search \"$(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 search \"$(realpath "$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 Action Window from Alfred - More like Alfred File Selection Hotkey when actioned on a selection in the Finder) alfa() { 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 if [ $# -eq 0 ]; then # If no arguments, pop Alfred Action Window in the working directory filePath=$(pwd) osascript -e "tell application \"Alfred 3\" to search \"$filePath/"\" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to keystroke (ASCII character 8)" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to keystroke $actionKey" else filePath=$(realpath "$1") if [[ -d $filePath ]]; then # If it's a directory path, make sure it's a full path and open the Alfred Action Window on it osascript -e "tell application \"Alfred 3\" to search \"$filePath/"\" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to keystroke (ASCII character 8)" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to keystroke $actionKey" elif [[ -f $filePath ]]; then # If it's a file path, make sure it's a full path and open the Alfred Action Window on it osascript -e "tell application \"Alfred 3\" to search \"$filePath\"" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to $actionKey" else # If there's more than one argument, 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) osascript -e "tell application \"Alfred 3\" to search \"$*\"" -e "delay $delayBetweenEvents" -e "tell application \"System Events\" to $actionKey" fi fi }
×
×
  • Create New...