Choose from List

Hi Guys

I have some script that i cannot get to work, it shows the user a list and if the slection one optiont it should do one thing if another soemthing, but i cannot geit to to work, amy ideas


set theQuestion to choose from list {"Prodcution", "201sa", "SS Meeting Room", "503ms"} with prompt " Choose a Calendar to Subscribe to"
if theQuestion is false then
    display dialog "You have clicked cancel" with icon stop buttons {"Exit"}
else
    if item is equal to "Prodcution" then
        tell application "iCal"
            GetURL "http://intranet/webdav/Conferance_Room.ics"
        end tell
    end if
end 

Hi,

the result of choose from list is always a list, just change this line


if (item 1 of theQuestion) is equal to "Prodcution" then

Thanks

but if i enter the second ( and then the thrid option it failes) here is my change


set theQuestion to choose from list {"Producation", "201sa", "SS Meeting Room", "503ms"} with prompt " Choose a Calendar to Subscribe to"
if theQuestion is false then
	display dialog "You have clicked cancel" with icon stop buttons {"Exit"}
else
	
	if (item 1 of theQuestion) is equal to "Producation" then
		tell application "iCal"
			GetURL "http://intranet/webdav/Conferance_Room.ics"
		end tell
	end if
	if (item 2 of theQuestion) is equal to "201sa" then
		tell application "iCal"
			GetURL "https://intrenet/weddav/"
		end tell
	end if
	
end if

try this


set theQuestion to choose from list {"Producation", "201sa", "SS Meeting Room", "503ms"} with prompt " Choose a Calendar to Subscribe to"
if theQuestion is false then
	display dialog "You have clicked cancel" with icon stop buttons {"Exit"}
else
	set chosen to item 1 of theQuestion
	if chosen is "Producation" then
		set theURL to "http://intranet/webdav/Conferance_Room.ics"
	else if chosen is "201sa" then
		set theURL to "https://intrenet/weddav/"
	else if chosen is "SS Meeting Room" then
		set theURL to "something"
	else
		set theURL to "something else"
	end if
	tell application "iCal" to GetURL theURL
end if

WHOOP WHOOP

works like a charge, thannks
you would not happen to know to put s

  • scroll bars,
  • little icons that live in the top right hand cornner ( minise, quit etc)
  • and a titel of the pop up box