Re: Move files to the right folder.
Re: Move files to the right folder.
- Subject: Re: Move files to the right folder.
- From: kai <email@hidden>
- Date: Wed, 18 Oct 2006 19:11:02 +0100
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"}
-------------
---
kai
_______________________________________________
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