• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sort lines in TextWrangler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort lines in TextWrangler


  • Subject: Re: sort lines in TextWrangler
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 11 Nov 2012 12:20:52 +0100

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



 _______________________________________________
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


  • Follow-Ups:
    • Re: sort lines in TextWrangler
      • From: "koenig.yvan" <email@hidden>
References: 
 >sort lines in TextWrangler (From: "koenig.yvan" <email@hidden>)

  • Prev by Date: sort lines in TextWrangler
  • Next by Date: Re: sort lines in TextWrangler
  • Previous by thread: sort lines in TextWrangler
  • Next by thread: Re: sort lines in TextWrangler
  • Index(es):
    • Date
    • Thread