Re: What is the most efficient/fastest Find & Replace technique?
Re: What is the most efficient/fastest Find & Replace technique?
- Subject: Re: What is the most efficient/fastest Find & Replace technique?
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 31 Jan 2003 04:31:35 -0800
On 1/30/03 10:54 PM, "David Hood" <email@hidden> wrote:
>
Don't forget "tr" on the command line
>
I've used it for doing batch find/replaces on folders on text files,
>
turning millions of tab marks to line endings.
>
>
tell application "Finder"
>
set NotTabbed to make new folder at desktop with properties
>
{name:"NoTabs"}
>
set PosNoTab to POSIX path of (NotTabbed as alias)
>
set Startfolder to choose folder
>
set ListofTabbed to every document file of Startfolder
>
end tell
>
repeat with loopCount from 1 to number of items in ListofTabbed
>
set tabbedFile to item loopCount in ListofTabbed
>
set sameName to name of tabbedFile
>
set butcherME to POSIX path of (tabbedFile as alias)
>
set command to "tr '\\11' '\\015' <" & butcherME & " > " & PosNoTab &
>
sameName
>
tell application "Terminal"
>
do shell script command
>
end tell
>
end repeat
Why are you telling Terminal to 'do shell script'? 'do shell script' is a
self-standing scripting addition - it doesn't need the Terminal.
--
Paul Berkowitz
_______________________________________________
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.