Parameter error on display dialog

I have written a script that allows me to ssh into one of my two boxes on my home network from my laptop. First it checks if X11 is running or not (and sets it to start, if not), and then it asks for the last digit of the ip address of the ssh host, since this is set by my airport via dhcp depending on the order that each box comes online.
Here’s the script:


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

The problem I’m having is that I get a “Parameter Error” whenever I run the script from Script Editor, and the entire first display dialog line is highlighted, indicating this as the source of the error. I’ve checked the syntax in both SE and Smile, and I can’t figure out why this isn’t working. Any ideas?

I think the problem is that display dialog can only have up to 3 buttons. The script shouild work fine if there’s 3 or less buttons.

Thanks, I didn’t know about the limitation on the number of buttons.
However, I did find a pretty simple solution, which I especially like, since I’m becoming more keyboard-centric on my Powerbook. It is just a text dialog, instead of a button dialog, and it works like a champ.
Here’s the code:


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

And since I’ve got passwordless ssh logins set up, ssh’ing to either of my boxes is just a click and number entry away. (Yeah, I know that typing “ssh -X adam@10.0.1.4” isn’t that difficult, but applescript makes life so much easier for us lazy people!)

– Yup, 3 buttons is max.
– Try this instead: just double click on the number in the dialog.

set reply to choose from list {“3”, “4”, “5”, “Other”} with prompt “What is the IP address upstairs? 10.0.1.” without multiple selections allowed

– returns the chosen number in reply as list

if reply is false then return – or whatever, was Cancel button
set ip_number to item 1 of reply – make ip_number a string