PDA

View Full Version : No buttons on AppleScript dialog




macuser154
Aug 18, 2010, 04:43 PM
I am writing a script that will spawn a dialog box 1000 times then quit. The problem I'm having is that whenever a dialog box comes up a button shows up on the dialog box and I can't have the user pressing "OK" 1000 times. So is there a way to just have a dialog box appear and then disappear without the user clicking a button?

set LoopDialog to "Window"

repeat 1000 times
display dialog LoopDialog
end repeat



chown33
Aug 18, 2010, 05:11 PM
Open your AppleScript Editor.

Choose File > Open Dictionary...

Select the "Standard Additions" listed item.

Select the "User Interaction" suite (left column).

Select the "display dialog" command (middle column).

Read the "giving up after integer" summary.

macuser154
Aug 18, 2010, 05:25 PM
Open your AppleScript Editor.

Choose File > Open Dictionary...

Select the "Standard Additions" listed item.

Select the "User Interaction" suite (left column).

Select the "display dialog" command (middle column).

Read the "giving up after integer" summary.


I tried that but I can't seem to get it to give up after anything less than a second. If I type in milliseconds (0.01) then the box stays there indefinitely.

chown33
Aug 18, 2010, 05:51 PM
I tried that but I can't seem to get it to give up after anything less than a second.

You can't. It won't.


Exactly what are you trying to accomplish? I can't think of any reason to display a dialog 1000 times non-interactively with a 10 ms timeout. Humans can't see that fast, so the net effect would be the same as displaying a flickering non-interative dialog-shaped thing for 10 secs. What purpose does that serve?

macuser154
Aug 18, 2010, 05:53 PM
You can't. It won't.


Exactly what are you trying to accomplish? I can't think of any reason to display a dialog 1000 times non-interactively with a 10 ms timeout. Humans can't see that fast, so the net effect would be the same as displaying a flickering non-interative dialog-shaped thing for 10 secs. What purpose does that serve?

It is supposed to be a type of performance tester, like Let1kWindowsBloom. The script starts, displays 1000 dialog boxes, then tells you how long it took.

angelwatt
Aug 18, 2010, 06:09 PM
It is supposed to be a type of performance tester, like Let1kWindowsBloom. The script starts, displays 1000 dialog boxes, then tells you how long it took.

It'll take 1000 seconds :D

AppleScript won't be what you want to use for this type of performance test. It's not designed to do what you want simply put. You might want to get Xcode installed and build from there.

macuser154
Aug 18, 2010, 06:13 PM
It'll take 1000 seconds :D

AppleScript won't be what you want to use for this type of performance test. It's not designed to do what you want simply put. You might want to get Xcode installed and build from there.

Hehe :D. I was trying to do it in AppleScript cause I don't know how to code, I've played with AppleScript in the past so I thought I'd give it a shot.

chown33
Aug 18, 2010, 06:18 PM
Hehe :D. I was trying to do it in AppleScript cause I don't know how to code, I've played with AppleScript in the past so I thought I'd give it a shot.

Is your goal to write a benchmark, or to run a benchmark?

macuser154
Aug 18, 2010, 06:20 PM
Is your goal to write a benchmark, or to run a benchmark?

I wanted to write an app that performed a benchmark on a users machine by spawning 1000 windows.