Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General simplifications #2

Merged
merged 1 commit into from
Jan 15, 2022
Merged

General simplifications #2

merged 1 commit into from
Jan 15, 2022

Conversation

vitorgalvao
Copy link
Contributor

The commit message isn’t great but these are a bunch of small corrections to things you’re doing the hard way.

You shouldn’t use with input as {query}, but with input as argv. With that change we shave three lines out of the script. Not only does it become simpler, it’s more robust. This is the proper way to handle multiple arguments and paths in bash and in Alfred, you don’t need to mess with IFS.

The File Buffer object is extraneous. You’re using it to process multiple files but that’s not what it’s for an it isn’t necessary for that, you can just use a File Action in multiple actions like normal.

I’ve also added an External Trigger, so people can invoke the optimisation from other Workflows. This is what prompted the PR, due to https://www.alfredforum.com/topic/17804-process-screenshots-w-imageoptim/.

I’ve only updated the files, not the Workflow file itself, because GitHub wouldn’t show the modifications to that.

If you want to add auto-updating capabilities to the Workflow, I can help with that as well.

@AlexanderWillner
Copy link
Owner

cool, thanks! will review it soon.

@AlexanderWillner AlexanderWillner merged commit 9023b6a into AlexanderWillner:main Jan 15, 2022
@AlexanderWillner AlexanderWillner mentioned this pull request Jan 16, 2022
@vitorgalvao vitorgalvao deleted the gen-simpl branch January 16, 2022 12:08
@benjaminhoffman
Copy link

obrigado @vitorgalvao! i was the one who posted in the alfred forum asking about auto-processing & auto-uploading to the cloud (ie dropbox)... I'm not sure I fully follow your directions because I am new to Alfred and scripting -- do you know of a solution that's out of the box? I was hoping to find a workflow whereby I take a screenshot and all other steps are completed for free.

@vitorgalvao
Copy link
Contributor Author

@benjaminhoffman Please don’t post the same thing in multiple places, it splits the conversation and is worse for everyone. I’ll reply on the forum later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants