I'm writing an app bundle, and an IF function won't work. I can't use end if, else if, or else... The error is "Expected end of line, etc. but found 'else if'".The if statement is marked by <<<<<<. Here's the code:
Code:
display dialog ¬
"Welcome to the magiccards.info Desktop Search!" with title ¬
"Welcome!"
set search_type to (choose from list {"View as Cards with Scans", "View as a List (Oracle)", "View as Checklist", "View as Scans only", "View as a Spoiler"} with prompt "What type of search will you choose?") as string
if search_type is "View as Cards with Scans" then set type_search to "card" <<<<<<
else if search_type is "View as Cards with Scans" then set type_search to "card"
else if search_type is "View as a List (Oracle)" then set type_search to "olist"
else if search_type is "View as Checklist" then set type_search to "list"
else if search_type is "View as Scans only" then set type_search to "scan"
else if search_type is "View as a Spoiler" then set type_search to "spoiler"
end if
set search_item to text returned of (display dialog ¬
"What card will you search for?" with title ¬
"magiccards.info Desktop Search" default answer ¬
"" buttons {"Cancel", "Search"} ¬
default button 2)
set AppleScript's text item delimiters to " "
set theTextItems to text items of search_item
set AppleScript's text item delimiters to "+"
set search_item to theTextItems as string
set AppleScript's text item delimiters to {""}
tell application "Safari"
make new document at end of documents
set URL of document 1 to "http://magiccards.info/query?q=" & search_item & "&v=" & type_simple & "&s=cname"
end tell
Last edited: