2011年8月14日日曜日

[AppleScript] テキストをデリミタで分割してリスト化

テキストをリスト化する構文。

Finderからパスを取得した場合などによく使ってます。

拡張子、ファイル名、階層数を受け取りたいときは便利。



try
set AppleScript's text item delimiters to "NewDelim"
set DelList to ""
repeat with i from 1 to (count text item of DelText)
set demo to text item i of DelText
set DelList to DelList & demo as list
end repeat
end try

0 件のコメント:

コメントを投稿