Re: sort lines in TextWrangler
Re: sort lines in TextWrangler
- Subject: Re: sort lines in TextWrangler
- From: "koenig.yvan" <email@hidden>
- Date: Sun, 11 Nov 2012 13:00:33 +0100
Le 11/11/2012 à 12:20, Axel Luttgens <email@hidden> a écrit :
> Le 11 nov. 2012 à 11:20, "koenig.yvan" a écrit :
>
>> Hello
>> I have a text file with about 90,000 lines so I assumed that it would be a good idea to use TextWrangler to sort the lines.
>>
>> After reading the dictionary, I wrote :
>>
>> set leDocument to (path to desktop as text) & "essai.txt"
>>
>> tell application "TextWrangler"
>> activate
>> open leDocument
>> sort lines of text document 1 with sort ignoring leading space and replacing target
>> close text document 1 with saving
>> end tell
>>
>> My understanding was that the output option [with replacing target]
>> would replace the document contents by the sorted one.
>> Alas it doesn’t.
>>
>> [...]
>
> Hello Yvan,
>
> Looking here at BBEdit's dictionary (should be similar to TextWrangler's one), it appears that things such as "sort ignoring leading space" and "replacing target" are described as properties, as if sorting options and output options were objects.
>
> So, assuming the front document is a text document, the syntax expected by BBEdit appears to go along these lines:
>
> tell application "BBEdit"
> sort lines of front document sorting options {sort ignoring leading space:true} output options {replacing target:true}
> end tell
>
> HTH,
> Axel
Thanks.
I will try that.
I am just surprised because
sort lines of text document 1 with sort ignoring leading space
behave as it was supposed to do.
I double checked because maybe it was just because the spaces embedded in my test file are responsible of the correct result.
It was really that.
Your syntax behave perfectly.
Yvan KOENIG (VALLAURIS, France) dimanche 11 novembre 2012 12:54:50
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden