Re: Need to rename files/folders - zsh shell
Re: Need to rename files/folders - zsh shell
- Subject: Re: Need to rename files/folders - zsh shell
- From: Graff <email@hidden>
- Date: Thu, 10 Jun 2004 18:17:49 -0400
On Jun 10, 2004, at 3:49 PM, Christopher Nebel wrote:
On Jun 10, 2004, at 10:07 AM, Gnarlodious wrote:
zsh:
autoload -U zmv
chars='[][?=+<>;",*-]'
zmv '(**/)(*)' '$1${2//$~chars/%}'
Anyone know how to plug this into Applescript?
Try this:
set s to "autoload -U zmv ; chars='[][?=+<>;",*-]' ; zmv '(**/)(*)'
'$1${2//$~chars/%}'"
do shell script "echo " & quoted form of s & " | zsh -s"
Incidentally, you may need to worry about creating collisions -- for
instance, "this" and "this?" will wind up having the same name. I
expect the zsh script above will simply replace one with the other.
Yeah, I dealt with that in my pure AppleScript example. It will try
adding numbers to the end of the file name just before the extension.
It will increment until it has tried up to 999 and then it gives up on
cleaning that name. If you have more than a thousand files with the
same name then you have some serious problems!
- Ken
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.