Re: do shell script "sort" not working
Re: do shell script "sort" not working
- Subject: Re: do shell script "sort" not working
- From: pete boardman <email@hidden>
- Date: Wed, 9 Nov 2005 09:39:34 +0000
On 8 Nov 2005, at 20:12, Chris Tangora wrote:
Can someone take a look and tell me if there is something I am
missing?
set RootFileFolder to
("HardDrive:Users:User:Scripts:PDF_Image_Counter")
set ImagesUsed_log to (RootFileFolder & ":ImagesUsed.log") as string
set ImagesUsed_POSIX to POSIX path of ImagesUsed_log
set ImagesSorted_log to (RootFileFolder & ":ImagesSorted.log") as
string
set Imagessorted_POSIX to POSIX path of ImagesSorted_log
set sort_script to ("sort -o " & Imagessorted_POSIX & " " &
ImagesUsed_POSIX)
do shell script sort_script
As Mark said, you are probably having CRuLF problems... You could
convert the line feeds as you go:
set sort_script to ("cat " & quoted form of ImagesUsed_POSIX & " | tr
\"\\015\" \"\\012\" | sort -o " & quoted form of Imagessorted_POSIX)
(- I use the octal codes for CR and LF because using "\r" and "\n"
looks odd when compiled.)
Or perhaps create the files using the LFs that UNIX commands prefer?
(I used 'quoted form' because I tried it on a folder called "untitled
folder" - space prevented it from running...)
Pete
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden