Mac - Applescript: Unterschied zwischen den Versionen
Aus Wikizone
Steff (Diskussion | Beiträge) |
Steff (Diskussion | Beiträge) |
||
| Zeile 7: | Zeile 7: | ||
https://mac.appstorm.net/how-to/productivity-how-to/automator-the-ultimate-automation-assistant/#more-4345 | https://mac.appstorm.net/how-to/productivity-how-to/automator-the-ultimate-automation-assistant/#more-4345 | ||
| − | == Mac - Scripts == | + | === Mac Automator - Scripts === |
| − | === .mov -> .mp4 mit Handbreak CLI === | + | ==== .mov -> .mp4 mit Handbreak CLI ==== |
Benötigt handbreak | Benötigt handbreak | ||
https://handbrake.fr/downloads.php | https://handbrake.fr/downloads.php | ||
| + | * Select "movie files" in services receives selected and "Finder.app" in application. | ||
| + | * Drag the "Run Shell Script" action. | ||
| + | * Select "/bin/bash" in Shell and "as arguments" in Pass input. | ||
| + | * Paste the script: | ||
| + | <syntaxhighlight lang="shellscript"> | ||
| + | for if in "$@" | ||
| + | do | ||
| + | /Applications/HandBrakeCLI -i "$if" -o "$if".mp4 --preset="Normal" | ||
| + | done | ||
| + | </syntaxhighlight> | ||
=== .mov -> .gif mit ffmpeg === | === .mov -> .gif mit ffmpeg === | ||
Version vom 5. Januar 2022, 14:41 Uhr
Mit Applescript kann man viel auf dem Mac automatisieren.
Applescript - Browser Screenshots automatisieren
Automator
Automator vereinfacht das Scripting und ist im Prinzip ein Tool um Skripte aus vorgefertigten Bausteinen zusammenzuklicken
https://mac.appstorm.net/how-to/productivity-how-to/automator-the-ultimate-automation-assistant/#more-4345
Mac Automator - Scripts
.mov -> .mp4 mit Handbreak CLI
Benötigt handbreak
https://handbrake.fr/downloads.php * Select "movie files" in services receives selected and "Finder.app" in application. * Drag the "Run Shell Script" action. * Select "/bin/bash" in Shell and "as arguments" in Pass input. * Paste the script:
for if in "$@"
do
/Applications/HandBrakeCLI -i "$if" -o "$if".mp4 --preset="Normal"
done.mov -> .gif mit ffmpeg
converting .mov files (created by MacOS screencasts for example) to small .gif files that you can easily send via email.
You will then have a quick action after right clicking any .mov file and can simply convert it to a small and optimised .gif file.
* fire up automator * create a new quick action * add a shell script to your workflow * paste the following code and don’t forget to choose “as arguments” in the pass input dropdown * save it
Fehler beim Erstellen des Vorschaubildes: Datei fehlt
for f
do
if [[ $f == *.mov ]]; then
/usr/local/bin/ffmpeg -i "$f" -pix_fmt rgb24 -r 10 -f gif - | /usr/local/bin/gifsicle --optimize=3 > "$f".gif
fi
doneThis is how everything should look after you are finished. mov_to_giv_automator
You need ffmpeg and gifsicle installed so if you haven’t install them via homebrew.
brew install ffmpeg brew install gifsicle