roganoalien Posted February 6 Share Posted February 6 Workflow to open specific folder inside a Code Editor or inside iTerm2. Not aware if is on any thread. Im the author of this workflow (Rodrigo García). Take a look to the repository and readme file for instructions Available shortcuts for code editors: Codium Visual Studio Code iTerm2 Sublime Text and PhpStorm also supported. Link to comment Share on other sites More sharing options...
vitor Posted February 6 Share Posted February 6 (edited) Welcome @roganoalien, and thank you for the submission. You seem to be trying to fit every object in a narrow space (e.g. storm). There’s no need for that, you can drag objects around and the canvas expands to accommodate. You can also ⌘- (command and minus) to zoom out. The code File Filter isn’t consistent with the others, as it only supports folders. More importantly, all of them are geared exclusively for web development files but one won’t know that unless inspecting the Workflow. That could be particularly confusing, as those text editors support many more file formats. Finally, the title and description make it seem the workflow is limited to one editor and terminal, but that’s not the case. In sum, in its current state I feel the workflow is very specific to a particular need and might be confusing to those encountering it for the first time, so not yet a fit for the Gallery. If you need more specific pointers, don’t hesitate to ask. That said, even in its current form the workflow is still a good example of using no-code objects to create something useful, so I’m sure there are people who’ll find value in it, especially as a starting point to make their own changes. Edited February 7 by vitor Link to comment Share on other sites More sharing options...
roganoalien Posted February 10 Author Share Posted February 10 Thanks for the reply @vitor !! I've done some rework and taken your advice and made a lot of fixes. I was wondering if I should make a new post or reply it over here? Link to comment Share on other sites More sharing options...
vitor Posted February 10 Share Posted February 10 3 hours ago, roganoalien said: I was wondering if I should make a new post or reply it over here? Here, please, so the progress is straightforward to follow. Link to comment Share on other sites More sharing options...
roganoalien Posted February 10 Author Share Posted February 10 @vitor cool! Here's the update: Same screenshots work for it. Now uses global variables and one needs to be set by the user for it to work (`terminal`). By default opens a `Dialog Conditional` to ask the user if the file/folder needs to be opened in just the code editor or in both terminal and code editor. There's also a cancel button to break the workflow. Can be changed from the global variables. Has both notification and sound feedback which can be disabled in the global variables. Now uses a python script to open the file/folder inside the app/terminal. I've changed the repo so it would not have the older name in the repo. New repo is here Fixed the narrow space of elements. There's no specification to filter any file nor folder so anyone can open every file if the code editor can handle it Let me know if there's any fix to be done Link to comment Share on other sites More sharing options...
vitor Posted February 11 Share Posted February 11 Looking better! I think the confusing part is mostly resolved, though the icon still shows a specific editor. Just the folder with the </> would be less ambiguous. Other things I noticed:You’re using Workflow Environment Variables for configuration, when they should be Workflow Configuration. This is specified in the submissions post.There are a bunch of node files in the workflow’s folder which don’t seem to be doing anything.File Filters may not be enough to find a file/folder, e.g. if they’re not in Alfred’s scope. Each File Filter would benefit from an accompanying Universal Action for Files only.The workflow in general doesn’t appear to work. On the first thing I tried, it failed to open in both the editor and the Terminal. The code seems to be the cause.You should never set the variables like Sublime\ Text. Escaping spaces is a shell thing, variables should have the correct name (Sublime Text).In the Run Scripts, don’t use with input as {query} but always with input as argv. There is a reason it’s the default. It makes escaping input unnecessary, which is important when you don’t know what the user’s input will be.I’d recommend doing it in bash or zsh. You can call variables like "${terminal}". It will be way less code and faster, since you’re using Python like a shell anyway (calling open).Overall good progress, as the new feedback mostly concerns the new functionality and that seems to be getting more advanced in a good way. Link to comment Share on other sites More sharing options...
roganoalien Posted February 13 Author Share Posted February 13 @vitor Hey! Made the changes you talked about it. Repository update Changes made: Workflow environtment variables are now Workflow Configurations Deleted node_modules and all stuff that alfy added Did not implement the Universal Action 'cause it breaks the flow and should but the file filter has the scope to `/Users` Removed the usage of `Sublime\ Text` to escape strings. Replaced `with input as {query}` with `with input as argv` Removed python scripts and now uses zsh script Let me know if there's something else needed to be fixed Link to comment Share on other sites More sharing options...
vitor Posted February 19 Share Posted February 19 (edited) On 2/13/2023 at 8:54 AM, roganoalien said: Did not implement the Universal Action 'cause it breaks the flow Universal Actions are another way of triggering. They provide flexibility, they never affect the methods already present. Again, please add them. Some people only use Universal Actions, not File Filters. On 2/13/2023 at 8:54 AM, roganoalien said: but the file filter has the scope to `/Users` That is too broad and will return a lot more than expected which pollutes the results. The correct setting is to have no Scope, thus leveraging the user’s default. On 2/13/2023 at 8:54 AM, roganoalien said: Let me know if there's something else needed to be fixed The action to open in terminal still doesn’t work. You can’t give both -a and -e flags to the open command, those options are inherently incompatible. What is your goal with that part of the code? Also, your Dialog Conditional says “Testing” in the title. The new icon looks pretty good. Thumbs up on that. Edited February 19 by vitor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now