• 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: Move files to the right folder.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move files to the right folder.


  • Subject: Re: Move files to the right folder.
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 18 Oct 2006 21:22:45 +0200


Le 18 oct. 2006 à 20:11, kai a écrit :


On 16 Oct 2006, at 16:09, Yvan KOENIG wrote:

set theFiles to "BE_00097_M3200W
BE_00158_M1370"
if theFiles contains return then
	set delim to return
else
	set delim to ASCII character 10
end if
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to delim
set FilesNames to text items of theFiles
set AppleScript's text item delimiters to oldDelim

There's a possible refinement here, Yvan.

Depending on the source of the text represented by "theFiles", the end-of-line signal might also consist of both characters: ASCII character 13 & ASCII character 10. (This would be typical in MS-DOS/ Windows systems - as well as in a number of text-based Internet protocols, such as SMTP, NNTP and POP3.)

If the end-of-line signal isn't known (or even if it is) AppleScript's "paragraph" text elements should do the trick:

-------------
set FileNames to paragraphs of theFiles
--> {"BE_00097_M3200W", "BE_00158_M1370"}

You are perfectly right

and I appreciate the other post in which you used it, a feature which I quite always forget ;-((

Is it true that sometimes we may have
ASCII character 13 & ASCII character 10
or
ASCII character 10 & ASCII character 13 ?



Yvan KOENIG _______________________________________________
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


  • Follow-Ups:
    • Re: Move files to the right folder.
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Move files to the right folder. (From: Jan Bultereys <email@hidden>)
 >Re: Move files to the right folder. (From: Yvan KOENIG <email@hidden>)
 >Re: Move files to the right folder. (From: kai <email@hidden>)

  • Prev by Date: Re: Kind of HTML files
  • Next by Date: Re: Move files to the right folder.
  • Previous by thread: Re: Move files to the right folder.
  • Next by thread: Re: Move files to the right folder.
  • Index(es):
    • Date
    • Thread