Don't understand use of Jon's Commands "keys pressed"

The description in the latest version of Jon’s Commands for “keys pressed” is minimal at best, and it doesn’t seem to work as I think it should. Try this, which I would have thought would sit in the loop until I pressed the control key and then drop out but it doesn’t stop running:

repeat
	delay 1
	if (keys pressed) = "control" then exit repeat
end repeat

[OS X 10.4.4]

Hi Adam,

‘keys pressed’ returns a list

Also, the Control key is not a good key to test with.

gl,

Is that only for OS X 10.4?
If so, is there any way to do it on Panther?

Ahh so, kel;

This works nicely:

repeat
	delay 1
	if (keys pressed) = {"page down"} then exit repeat
end repeat

Page down is apt as well. I want a little script that works otherwise, to page through a php-driven site by appending &p=n to the rest of the URL as I finish looking for something on each page. It has to have some means of waiting for me to say go, and a dialog box doesn’t cut it because it won’t let me interact with the page the way I want to.

Thanks,
Adam

PS: to ScriptWizard. Get the latest version of Jon’s Commands and I think it will work in Jaguar too.

Hi Adam,

On my iBook I get:

{“key64”, “Page Down”}

because you have to press the “fn” key with the down arrow. Just in case you wanted to know. So you could write:

if (keys pressed) contains “Page Down” then …

gl,

Thanks for that. I have a keyboard (that came with the G5) with a separate key for page down, so it didn’t occur to me that not all did. I’ll change the code to “contains” or “is contained”