Applescript with terminal find and remove folders -
so want try , make script find , delete multiple folders in folder applescript:
tell application "terminal" activate script "find (path folder) -type d *-name "foldername*" -exec rm -rf {} \;*" end tell
applescript wont run after -type d because of "syntaxerror expected end of row" dont understand why because works if run
find (path folder) -type d *-name "foldername*" -exec rm -rf {} \;*
in terminal
you use command do shell script
same thing running in terminal. , don't need tell
block run this.
also here 2 points @ in script.
if want use
"
quotes in quoted shell script need escape them using\
. i.e."some script \"some name\" more script"
. otherwise, use single quotes in double quoted script.if want
\
run in script need escape in applescript. i.e.rm -rf {} \\;*"
final script more this:
do shell script "find (path folder) -type d *-name 'foldername*' -exec rm -rf {} \\;*"
Comments
Post a Comment