• 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
Sort don't return what I wait
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sort don't return what I wait


  • Subject: Sort don't return what I wait
  • From: KOENIG Yvan <email@hidden>
  • Date: Mon, 16 Jun 2008 18:57:21 +0200

Hello

I wish to sort a list of filenames.

As it may long, I thought that a shell script would be a good tool.

Alas, it doesn't sort the way I want.

May you find where is the wrongdoer (yes, it's me)

--[SCRIPT]
property lineFeed : ASCII character 10
property maListe : {}

set my maListe to {"bug_or_flaw.pages", "anomalies_Numbers.pages", "apostrophes.pages", "AppleWorks & AppleScripts.pages"}

set tt to my recolle(my maListe, lineFeed)
set tt to (do shell script "echo " & quoted form of tt & " | sort")
set my maListe to paragraphs of tt

(* returns

{"AppleWorks & AppleScripts.pages",
"anomalies_Numbers.pages",
"apostrophes.pages",
"bug_or_flaw.pages"}

but I want

{"anomalies_Numbers.pages",
"apostrophes.pages",
"AppleWorks & AppleScripts.pages",
"bug_or_flaw.pages"}

*)
--=============

on recolle(l, d)
	local t
	set AppleScript's text item delimiters to d
	set t to l as text
	set AppleScript's text item delimiters to ""
	return t
end recolle

--=============
--[/SCRIPT]

Yvan KOENIG (from FRANCE lundi 16 juin 2008 18:57:05)


_______________________________________________ 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 don't return what I wait
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: merging 2 images to 1
  • Next by Date: Re: Sort don't return what I wait
  • Previous by thread: merging 2 images to 1
  • Next by thread: Re: Sort don't return what I wait
  • Index(es):
    • Date
    • Thread