Change directory and applescript terminal command -
i have tried following cannot seem work:
do script "cd ~/desktop/test; x in ls -1 | sed -e 's/^\(.\).*/\1/' | sort -u; mv -i ${x}?* $x done"
i'm wanting perform command in applescript. run in applescript , error regarding "" marks not sure how correct it. i'm complete newbie applescript. willing learn little lost.
thanks
note in applescript, whenever pass shell script command \
, use \\
represent it.
as:
do shell script "cd ~/desktop/; x in `ls -1 | sed -e 's/^\\(.\\).*/\\1/' | sort -u`; echo ${x}?* $x; done"
also, uses for x in `command`, instead of for x in command. it's because `` treats inside command, , expects result of command, $():
do shell script "cd ~/desktop/; x in $(ls -1 | sed -e 's/^\\(.\\).*/\\1/' | sort -u); echo ${x}?* $x; done"
Comments
Post a Comment