politicus Posted September 20, 2020 Share Posted September 20, 2020 After literally hours, I finally find a solution to add a drop shadow effect on a given .png file. The "one-liner" I found is working as I could make it work in zsh (cf. the image below). The problem I have is I do not know how to make it work in a file action with a run script action. I simply attached a file action to this run script action. My question is: how do I do for Alfred to get the value /PathToMyFile.png which is the path of the file I want to add the drop shadow effect? Thank you. Link to comment
deanishe Posted September 20, 2020 Share Posted September 20, 2020 “With input as argv” means the filepath(s) are passed to your script as command-line arguments. In shell, you access them with $1, $2 etc. So you replace "PathToMyFile.png" with "$1". I’d be surprised if that script actually works, since convert isn’t a standard command. Normally, you’d need to specify its full path, i.e. /usr/local/bin/convert. politicus 1 Link to comment
politicus Posted October 4, 2020 Author Share Posted October 4, 2020 1°) Sorry for the late reply I didn't see any notification about your answer. Thank you for the precision about "argv". Makes me understand a little bit more about how Alfred works with scripts. 2°) I changed the script to: Quote /usr/local/bin/convert "$1" -bordercolor white -border 5 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage "$1" It is now working like a charm! Thank you! Link to comment
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