Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An alias that uses perl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An alias that uses perl
Authored by: TheGS on Mar 07, '02 12:00:15AM
Somebody else suggested that a drag-and-drop tool would be useful. Here's a quick AppleScript droplet that accepts files dropped onto it (ignoring directories) and then passes the absolute path of each file to a one-line perl script.
 on open fileList
   repeat with x in fileList
     if folder of (info for x) is not true then
       set y to POSIX path of x
       do shell script ("perl -pi -e \"tr/\\015/\\12/\" " & y)
     end if
   end repeat
 end open


[ Reply to This | # ]
An alias that uses perl
Authored by: oink on Mar 08, '02 01:55:31PM

can I use Logan's "alias mac2unix="perl -p0015l0012e '' -i $*"" with this script

on open fileList
repeat with x in fileList
if folder of (info for x) is not true then
set y to POSIX path of x
do shell script ("perl -p0015l0012e '' -i" & y)
end if
end repeat
end open

doesn't work... no error, just wouldn't convert.

Thanks



[ Reply to This | # ]
An alias that uses perl
Authored by: TheGS on Mar 08, '02 09:05:18PM

You might be missing a space between the '-i' and the path to the file.



[ Reply to This | # ]