list string containment problems

hi,

i’m trying to get a list of all tracks whose contens contain both, four empty spaces in a row and the @ symbol.
i’m not figuring out how to test the resulted list of the first boolean test for containment of the @ symbol.
any cluse?

jns

set myDelimiter to "    "
set my2ndDelimiter to " @ "

tell application "iTunes"
	
	set myL to get comment of every track of library playlist 1 whose comment contains myDelimiter
	
end tell

get every item of myL where it contains " @ "

Hi jns,

it works for example with a second list and a repeat block

set myDelimiter to "    "
set my2ndDelimiter to " @ "

tell application "iTunes"
	try
		set myL to get comment of every track of library playlist 1 whose comment contains myDelimiter
	on error
		display dialog "no match found"
	end try
end tell

set My2ndL to {}
repeat with i in myL
	if i contains my2ndDelimiter then set end of My2ndL to contents of i
end repeat
end

thanks a lot for your fast reply.
just somehow i wanted to avoid a repeat block and find a simpler and faster(?) solution.

but it seems like it doesn’t work in this case.

cheers
jns

this works, too:

set myDelimiter to "    "
set my2ndDelimiter to " @ "

tell application "iTunes"
	set myL to get comment of every track of library playlist 1 whose (comment contains myDelimiter and comment contains my2ndDelimiter)
end tell

Hi, jns. Do you mean something like this?

tell application "iTunes"
	set myL to tracks of library playlist 1 whose comment contains "     " and comment contains "@"
end tell

Edit: Sorry. I see Stefan’s just posted something similar.

thanks both for your help!
that˜s exactly what i was looking for!

i tried using and, but i didn˜t repeat “comments contains”…

cheers
jns

Just for future reference, AND (and OR) requires that both phrases connected by the ‘and’ have boolean results by themselves, e.g. contains “blah” and contains “bling” where each is a stand-alone boolean expression.