Variables in list form....

Hi,
How can I get some code to execute for every item in a list that is in a variable?
eg:


--works
tell application "System Events"
	set theApps to name of (every process) that name is not "loginwindow"
end tell

--doesn't work
for every item in theApps
do shell script "killall -SIGCONT " & theApps
end for every item

thanks in advance


tell application "System Events"
	set theApps to name of every process that name is not "loginwindow"
end tell

repeat with oneItem in theApps
	do shell script "killall -SIGCONT " & oneItem
end repeat

Wow! In all my ten years or so of AppleScripting, I’ve never come across the that keyword ” though it works as a synonym for whose at least as far back as OS 9.2.2. :slight_smile: It’s mentioned in the new AppleScript Language Guide, but not in the 1999 one.

I’ve been trying to think of cases where it might be used to good linguistic effect. where and whose are usually interchangeable and where also makes sense in English when used slightly differently with booleans:

tell application "System Events"
	first application process whose frontmost is true
	first application process where frontmost is true

	first application process where its frontmost is true
	first application process where it is frontmost
end tell

Does anyone know of cases where that might be used and still make reasonable sense in English?

The difficulty seems to be that “that is” is not acceptable.

Nigel, I can’t think of anything.

See also:
repeat Statements
Filter

well thanks for answering my question :smiley: