My apologies for not being more specific in my first post!
I am building an integrated iTunes browser on the ipad using Lemur.
I am retrieving information from a [shell object] in Max using an osascript command (to run an applescript at a location on the computer).
When the device first opens. This information will be stored in a [coll object] for data management later (alphabetically sorting, loading the track, playlist display)
With the script:
tell application "Tunes"
name of every track in (get some playlist whose special kind is Music)
end tell
Creates a list ouputted to max in this format:
song1
song2
song3
song4
etc
This is to my advantage because it can be easily iterated without using any text/string/list processing in Max because a simple Max message will iterate with items separated by a comma.
However, if a song name contained a comma already, it will mess up my iteration. The output will look like:
song1
song2
so
ng3
song4
son,
g5,
etc
I wouldn't have the remove the commas if what appeared in Applescripts was sent correctly to Max, however it seems Max removes the 'quotation marks' of each item in the list.
A list of strings appear in Script Editor as:
"song1", "song2", "song3"
A list of strings appear in Max (directly after stdout of [shell] object) as:
song1, song2, song3,
So in Applescripts, I need the code which will iterate through a list, and remove the comma. This is my attempt on the scripting the process per item:
set mystring to "string with a , in it"
set TID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set pieces to text items of mystring
set mystringleft to text items 1 thru text item (whose name is ",")
set mystringright to text items (whose name is ",") thru count of text items
set result to mystringright & mystringleft
and obviously, doesn't compile
With regards to the Terminal command tr -d, I don't want to run 2 different processes to get my result. Sending the result of an Applescript to a [shell] object seems less efficient, unless it was my last resort or the information I desire could be retrieved from the iTunes .xml file in shell.
Thanksyou for the replies!