My go-to would be to write a bash script that launches the thing, another line that fetches the PID and force-quit the thing after a time.
That said, I did a google search for a more elegant script, and here's one result: http://osxdaily.com/2014/09/05/gracefully-quit-application-command-line/
Hey,
I do this all the time with wallpapers I want to keep.
My wallpaper usually cycle between Unsplah and Pixabay. My automation is based on Hazel, which watches the Downloads and Wallpapers folders and goes like :
New image file containing Unsplah or Pixabay in the name -> Move to Pictures - Wallpapers.
New file in Pictures - Wallpapers -> If the size is greater than x (I've set 5MB), then open it with ImageOptim. This app handles it properly: opens in background, compresses, replaces the original with the compressed and closes.
All this is pretty seamless. I just have to download the picture, but I guess you can manually move it to the watched folder.
If you like things tidy, take a look at Hazel. I use it to move all my files on the desktop to the downloads folder (I really hate a messy desktop) and I have it set to remove any file older than 7 days
from the downloads folder (I like my space and really don't need that PDF I downloaded once to check something).
But now back to Automator. It is really a program you learn by trial and error. There are several kinds of of automator types, but lets start with a application that you open like any other application (and you can launch from spotlight).
Open Automator and pick Application
as your type search for launch
and see how you go from there.
Open safari pages: again create a Application
and search for get specified urls
and top it of with `display webpage
Wow sometimes its as easy as just doing it. Just type Quit All Applications
and save the Automator Application
the last one can be done with Automator, but is much easier with Hazel.
Hope it helps.
You may consider keyboard maestro for those tasks. That way you can use the control flow functions to pause to verify the color and size. You can also macro the file creation and use applescript if needed.
It is probably possible to get somewhere with Automator, but it is going to cost you a lot of headache to get anywhere.
Maybe you have better luck taking a look at BetterTouchTool all is it only to have a bigger community to help you out.
I've just created a Quick Action that resizes images to 480 pixels:
Save that, use the Services contextual menu to test it out on an unimportant file, then tweak as necessary. The Quick Action should be saved in /Users/~/Library/Services
Alternately, imagemagick is a powerful tool that can be easily installed with Homebrew and then shell scripted.
Thank you! Works, although I didn't understand how. Unfortunately, the conversion completion notification does not work. What am I doing wrong? screen
Yes, I am on Catalina. I see zsh
appearing as the default. I'll start there.
Regarding the script. The URL scheme for Micro.blog is
microblog://post?text=<message>
So do you know where that would fit in? How I get the input text to the message part of that scheme? I have tried something and got an error.
I hope that the dishes are going well! :)