| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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
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: http://lists.apple.com/mailman/options/applescript-users/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>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.