Jump to content

GuiB

Member
  • Posts

    366
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by GuiB

  1. 8 hours ago, PaperCloud10 said:

    but it doesn't when I bring up the file actions menu

    That's why I said "I think what you would want" since this bypass the file action menu and would them be faster to action. Also, by working "with the selection from inside Alfred" I meant from a standard Search, File Search or File Browser from inside Alfred since the selection would be passing the file path to the workflow trigger. However, this is not working from inside the File Action Menu.

     

    If you don't like to have it directly accessible and would prefer to only have a shortcut from inside a File Action, then it's not possible at the moment. If you read the "Alfred 4.5 Beta: Take a first look at Universal Actions" thread (which is a new feature that works like the File Action, but now we can add actions for URLs and Texts), @Andrew mentioned here that we will be able to connect a hotkey to an action in the future. However, from my understanding this won't be to add hotkey inside the Universal Action panel, but to access a defined action globally from a HotKey trigger. So, this would be basically the same as the workflow I posted.

     

    The only way I see to make it work for your use case at the moment would be to set a hotkey that would automatically type the title or your wanted action and activate it, but the problem here is that the workflow trigger would work in any Alfred's text field, so you could accidentally trig it from anywhere in Alfred and not just specifically at the File Action panel.

     

    Another way I can think that may make it work a little more closely to what you want would be to make use of the new Universal Action and which we can now directly access the actions that contains a second panel view (ex: "Open with..."). However, this will also be accessible as a global hotkey, so not inside the File Action panel, but this will pop a list of applications that can open your file and VSCode could be at the top (not guaranteed), so you would be able to activate it using the Alfred shortcuts (CMD+1, CMD+2...)

     

    Here is an updated workflow with those 2 ideas added so you can test and see if something works for you: https://d.pr/f/EM3rbg

  2. 4 hours ago, Vero said:

    I've checked out your workflow and created a couple of my own tests. I can reproduce the issue for Fn but all other mods behave as expected. Could you take a look at your Universal Actions hotkey preferences, in case you've changed anything from the defaults?

    You're right! I investigated more and I saw one of my hotkey trigger in one of my workflows that was set to be active only in Alfred and activated using "OPT+Return". I've now deactivated it since I think it's not a great key combo key to have since Alfred uses it often and now the Universal Action modifier key work. Sorry for that, but at least that made me discover the problem with the Fn modifier key

  3. 25 minutes ago, deanishe said:

    Probably, but I don't think that's super helpful here, as CMD+L makes Alfred close, so it's not much help for quickly checking the full paths of a list of  results.

    Actually, this has never been the case on my side and I'm using the Large Type feature a lot as some kind of preview for my workflows that I've been popping and closing using CMD+L (pop) and ESC (close) and keeping Alfred always open so I can move to another result and preview it with CMD+L again...


    But now that you say that, I see in the "Large Type" section in "Alfred Preferences -> Features" there's a toggle to "Auto Hide Alfred when showing Large Type" which should be active on your side... I find it very useful to have it unchecked so I can use the Large Type feature as a preview, but yes now I see that this could be a problem for this feature requests.

  4. 1 hour ago, deanishe said:

    Is there a better way Alfred could show the full path?

    While doing a File Search, I think Alfred should put the file path into the Large Type parameter so we can see the full path using CMD+L instead of the query

     

    During a standard Alfred search, it could be questionable if the "Title" should be put into the Large Type parameter or the "Subtitle", but what about using CMD+L and CMD+ALT+L to switch between both? I mean, like we can have with the Calculator Large Type which pop the Result with CMD+L or the Query using CMD+ALT+L

     

    So more generally, Alfred could use (which would work in the standard search or file search):

    CMD+L : Show the Title in Large Type (That would be the file or application name)

    CMD+ALT+L : Show the Subtitle in Large Type (which would be the file path)

  5. I think what you would want is simply a workflow with a "HotKey" trigger that pass the selection to an "Open File" set to open in VSCode. This has the advantage to work with the selection from inside Alfred as well as directly inside Finder

     

    Here is an example workflow, simply set the HotKey trigger to your preferred hotkey: https://d.pr/f/0tug1h

  6. @Andrew, I'm seeing another bug when using action modifiers, more specifically when using the "option" or the "fn" key individually. In short, the modifier subtext appears, but the flow never goes to used modifier path, but goes to the main one (standard one, like if no modifier used). The problem doesn't seem to be present when using multiple modifiers (ex: CMD+Option)

     

    Here is a workflow I did for testing: https://d.pr/f/ix941c

  7. 2 hours ago, deanishe said:

    Which application was it again that caused you to make Alfred open files individually, instead of all at once? Can you check if it's still causing problems?

    Hmm, I didn't know Alfred was opening files individually instead of sending everything together... I thought that it was the default behaviour for the applications I was using to open the files in different windows, but now I see they group them in different tabs in the same window if I do it from the terminal which I would prefer.

     

    I would also be interested in knowing which applications were causing problems and perhaps the normal way could be set as the default one and since that we can add Action Modifier for the Universal Action workflow object, maybe a modifier (ex: alt) could be used now to switch the open action to open the files one by one?

  8. @kagi, I don't know if you've read all the posts above, but @Andrew added the possibility to pop the "open with" action directly with the latest beta update (called "Jump to" in the "Action in Alfred" workflow object). So, if you want to use it right away you can do it!

     

    Here is an updated version of my workflow I gave you, but with this new feature: https://d.pr/f/Qb4Pn2

  9. 13 hours ago, Andrew said:

    If you could narrow down what is causing Alfred to show, I can perhaps re-look at the logic to prevent it?

    Just to give you a situation that this was a problem on my side. It's not the same as @analogue_man but can give an idea of a way to get around it inside a workflow. I'm also using modifier keys a lot while working with text and could have stumbled on this from time, but I know it could happen when I have a brief hesitation while doing a shortcut.

     

    Example, my Alfred modifier use CMD+CMD and I briefly tap CMD one time because I wanted to do something and stopped while doing it, but did another key combination that use CMD. So, since I'm doing 2 CMD one after the other then my workflow gets triggered, which I think is fine and especially since I've set my HotKey to Pass through to make it faster.

     

    However, I thought that setting the option to "Wait until modifier keys are released" will block if I press another key that is not part of my double key trigger. I mean, if I press CMD, CMD+Shift+Left Arrow and release, I would think that Shift+Left arrow could be catched and break the CMD+CMD+Release combo (just an idea of how this could be improved)

     

    Regarding my problem in my workflow that I got around. In short, I wanted to get the URL from the front browser that doesn't have AppleScript (ex: Firefox). So, my workflow was doing CMD+L; CMD+C) rapidly and this was triggering my CMD+CMD trigger. I got around it by wrapping the L+C around a keyDown('eCmd') and a keyUp('eCmd').

     

    Example:

    First (which activate my CMD+CMD hotkey trigger):

    #!/usr/bin/env osascript -l JavaScript
    
    var sysEvents = Application('System Events');
    
    sysEvents.keystroke("l", { using: 'command down' });
    sysEvents.keystroke("c", { using: 'command down' });

     

    Then (wrapped to get around):

    #!/usr/bin/env osascript -l JavaScript
    
    var sysEvents = Application('System Events');
    
    sysEvents.keyDown('eCmd');  // Using keyDown/keyUp to not interfere with a CMD double tap hotkey
    sysEvents.keystroke("l");
    sysEvents.keystroke("c");
    sysEvents.keyUp('eCmd');

     

    Another way was to insert a "delay(0.16);" between the keystroke commands, but I prefer to send the keys as fast as possible

     

  10. 5 hours ago, Andrew said:

    @GuiB b1246 should fix this, thanks again

    Yes, fixed on my side with this build!

     

    1 hour ago, deanishe said:

    1. What's "Jump To"? Sounds like I'm missing out on something good.

    Look inside the "Action in Alfred" workflow object, there's now a "Jump to" section. This is used to directly "jump to" a specific action that has a second panel (ex: Open with..., Copy/Move to..., Open URL in...).

  11. @Andrew , just found another bug...

     

    I don't remember seeing this before, but in build 1245 I'm getting double key input entries when there's no match in the Universal Action list. I mean, for example with a file action, if I input "open" then it's ok, but if I type a key that doesn't match an item then the keystroke gets doubled (ex: "open e" returns "open ee")

     

    Here is a screencast to show you: https://d.pr/v/XwWNMN

  12. 5 minutes ago, Andrew said:

    I've just put b1245 out which should fix the preview not appearing until you arrow down issue, let me know.

    Yep, fixed on my side with that build

     

    6 minutes ago, Andrew said:

    Again, thanks for your direct help with testing this, it's invaluable!

    Happy to help! I don't always have a lot of time, but I like playing with Alfred between rushes of hard work and I finished some long ones not many days ago :)

  13. Ok, some more testing, here are some remarks (mainly GUI things):

     

    Open with... :

    • I feel it's strange that the preview of the file (right side of the UI + Top left icon) is slow to appear while it is instant when calling with the standard Universal Action shortcut. It seems the preview wait until the applications icons are done appearing instead of being the first one. Not so much of a problem, but the popup feel more sluggish because of that.

    Recent document... :

    • The list appears correctly, but the preview on the right as nothing, like if nothing is selected even if the first item is. When we change file with a down arrow this is fixed
  14. Hi @Andrew, I was writing to you regarding this feature!

     

    In short, that is great! but I'm questioning myself if it would be better for you to find a solution that could work to call any Universal Action item (not just the built-in) than to start with something and then make changes later on to allow the possibility... I mean, I'm just thinking in regards to the future of Alfred and its development, so you better know the inside and how this could work out and how this could be extended, but I simply just don't want you to be blocked by rapidly adding this feature.

     

    I was thinking of 2 solutions:

    • Something like the "Workflow Triggers..." menu we get from the "Call External" workflow object that would give us the list of all our items for a specific type
    • Simply having a text field where we could insert the title of the item that we want Alfred to invoke (something like the standard macOS shortcut to menu items; ex: "Call item with title: name_of_title_here"). This way, Alfred could dynamically select the matching action from its title when it parses the action list when invoked.

    With that said, I like the newly added "Jump to" feature to the "Action in Alfred" and from some testing this seems to work great (I tested all the actions and they popped the right UI). So, that's great to have it, thanks! I'll let you know if I get any problems while using the feature a little more.

     

    One thing I think that may cause problems to some users: it's not so obvious that some items only work with specific type of items (I'm thinking that some user may ask for help why it doesn't work on their side), maybe you should filter the "Jump to" items when "Treatment" is set to a specific type so people know that some actions can't be done with those type. I know it's a little tricky for some, so maybe your mention "If no relevant arguments are passed... no actions panel will show" is enough... I'm just mentioning in case you get an idea

  15. 23 minutes ago, kagi said:

    Now, if i could get a hotkey directly to the 'open with' action that would help me move off of LaunchBar entirely... !

    Yes, that would be great! In the meantime, here is my workaround: https://d.pr/f/6uP48n

     

    In short, the workflow simply connect a HotKey workflow object (that work on the selection) to a "Run Script" that contains the script:

    on run argv
      tell application id "com.runningwithcrayons.Alfred" to action argv
      tell application "System Events" to keystroke "open with" & return
    end run

     

  16. 27 minutes ago, Andrew said:

    Thanks for spotting, I needed to add a check for empty string. Before, files would be checked for existence, so naturally fail.

    I'm not sure if you mean that you will now keep the possibility to pop the Text Action list with an empty string or not, but my point was also to let you know that the behaviour is different when called with the normal Alfred hotkey (the UI doesn't appear) vs AppleScript (the UI appears).

     

    44 minutes ago, Andrew said:

    This has always been in the plan, but requires an overhaul of the buffer. As such, this is not targeted for 4.5.

    Great! :)

     

    29 minutes ago, Andrew said:

    In your example, if you had used a full URL, Alfred will automatically recognise text and a URL, e.g.

    Yes I know, that's why I removed the "https://" since the idea was to "force" Alfred to a specific type. However, that's also why I'm questioning if it is really useful since many workflow won't be able to interact with the "alfredforum.com" as URL without the scheme part of the URL. I mean, it is most useful to force the type to Text than to URL or File, but if we have a custom workflow that knows what to do when it receives those kind of incomplete strings. So, since we have the possibility to force to specific types, I think the feature would be complete if a possibility to force to multiple types exist so we can make use of the different types the way we want it.

     

     

     

  17. Hi @palebluedot, no it is not possible to show the preview pane on the right side of the main Alfred popup UI. It is a special view that we get on the Alfred File Browser, Clipboard History, Snippets Viewer, File Action, Universal Action (see Alfred beta 4.5). I would also like to have access to it more (actually, I would really like it accessible from a Script Filter), but at the moment to get what you want you can make use of the Alfred File Browser if your files are all in the same directory or not too far if you don't mind getting in and out of a directory (See the action you get in the File Action list: "Browser Folder in Alfred" or put the path directly in the main Alfred text field).

     

    Beside that, if you want to quickly preview the Alfred results, then your best option is to pop the QuickLook preview using "Shift" or "CMD+Y". Then, when the QuickLook popup is in front of you, you can still use the Up/Down arrow to switch between items and the preview will follow. This works from the main Alfred popup or inside the Alfred File Browser.

     

    Hope this helps!

  18. Great! From my testing on the version build 1240 (and now 1241), everything seems to be working well. There are just some little changes that I wanted to mention to you in case they are not wanted.

     

    Changes from build 1240:

    • Before, when nothing was selected and we called the Universal Action from AppleScript, then nothing would pop (no Alfred UI; we were getting an "Erreur dans Alfred 4 : No valid paths to action"), but now we are getting the Text Action with nothing (no matching actions; 0 words, 0 chars). I thought it could be a way to have an action list that appears when nothing is selected in the "Show for:" parameter inside the Universal Action workflow object, but no action appears in this situation whatever the settings are. So maybe it would be better to keep the old behaviour?

    To show you the AppleScript that now pop the Text Action UI, but wasn't before:

    tell application id "com.runningwithcrayons.Alfred" to action ""
    • I tested the Alt+Down Arrow shortcut inside the Clipboard History and Snippets list to see if you added my idea regarding a "Text Buffer" for sending multiple items to the Text Actions, but now it pops the Universal Action (Text Action) UI like if we did the Right Arrow or Fn or Ctrl key. I’m not sure if this is wanted (it wasn’t this way on the older build), but I thought that maybe you should prevent that in case you want to use this shortcut later so no one gets used to it since it is not specified anywhere in Alfred that this could be used for that.

    Regarding the Universal Actions UI on URLs and Text Actions when multiple items are used. Yes, this is better! I know you said you will improve the UI, but just to let you know, the main thing that’s bothering me a bit is that we can’t see where the items end or if it’s simply a newline inside an item. I mean, it would be great to have a divider between each item to better see them in the preview on the right side of a Text Action.

     

    Thanks for adding the "as type" to force a specific type in AppleScript. One thing I'm questioning myself is if it would be useful to set the argument to accept a list so we could force to pop the "Multiple Type" action list. I mean, to write:

    tell application id "com.runningwithcrayons.Alfred" to action { "Alfred Forum URL", "alfredforum.com" } as type { "text", "url" }

    At the moment, the only way to access the Multiple Type list is by omitting the "as type" option and let Alfred decide, but in this case "alfredforum.com" is not detected as an URL since there's no "https://" in front. It is right that this is not a URL, but a workflow could interpret it

     

    With that said, thanks a lot for your work and thanks for including some of my ideas!

  19. 21 hours ago, gogoizzy said:

    Hi GuiB, that worked!! Thank you. I got it down to 0.5

    Great that it worked! However, for the delay I find 0.5 to be quite slow (I can set mine down to 0.11 before seeing bad outputs), is it the delay time after each "Copy to Clipboard" item or you mean the whole workflow takes 0.5 to do everything? Maybe the application you are outputting to is slow... If it takes 0.5 second between each Copy to Clipboard, then I would see if the AppleScript using keystrokes method is faster without errors (see second snippet in my workflow: \\wftc2 ).

     

    And actually, based on your first screenshot, I would guess that TouchPortal use "keystroke" to "write" the text content. So, you can try my other method from my above workflow and see if it's faster. Or if you are happy as it is, then have fun automating your work! :)

  20. You will need to insert "delay" after the clipboard objects so the system have the time to copy the text to the clipboard and then output it before going into the next object. Beside that, if you don't want to delay and since those are short strings, you may be better to output keystrokes using AppleScript. Depending on your content, pasting is faster than keystrokes, but since you need to wait some time to copy the content then for short strings the keystrokes may be faster to do the process.

     

    So, here is a workflow as example to show you both methods and I have added a "clipDelay" variable so you can try and see if you can reduce the delay time depending on your system and content.

     

    Here is the workflow: https://d.pr/f/gnSzAS

×
×
  • Create New...