What does the error “No result was returned from some part of this expression” mean?
I don’t know exactly which part of the script it came from, but in case it helps here is the part of my script that was being run. It worked perfectly, but once it was done it threw the error!
else if name of theObject = "newPost" then
------ get subject text
tell window "newpostwindow"
set subject_text to contents of text field "NewPost_subject"
end tell
------get post text
set post_text to the contents of text view "post_text1" of scroll view "NewPost_post" of tab view item "post" of tab view "tabgroup1" of window "newpostwindow"
------get post locations
if enabled of button "NewPostOptions_MacScripter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" then
if name of the current menu item of popup button "NewPostOptions_MacScripter_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "studio" then
-- in studio
is_App_Active()
tell application "Safari"
activate
set URL of document 1 to "http://bbs.applescript.net/post.php?fid=3"
tell application "System Events"
delay 12
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
keystroke " " & return
end if
else if name of the current menu item of popup button "NewPostOptions_MacScripter_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "applescript" then
-- in applescript
is_App_Active()
tell application "Safari"
activate
set URL of document 1 to "http://bbs.applescript.net/post.php?fid=2"
tell application "System Events"
delay 12
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
keystroke " " & return
else
log "on"
end if
else if name of the current menu item of popup button "NewPostOptions_MacScripter_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "other" then
--in other
is_App_Active()
tell application "Safari"
activate
set URL of document 1 to "http://bbs.applescript.net/index.php"
end tell
display dialog "When you have chosen the forum, and clicked new post then come back and press ok"
tell application "Safari"
activate
tell application "System Events"
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
keystroke " " & return
end if
end if
if enabled of button "NewPostOptions_Apple" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is true then
if name of the current menu item of popup button "NewPostOptions_Apple_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "OS X" then
is_App_Active()
apple_logon()
tell application "Safari"
activate
set URL of document 1 to appleMakeNewPost & "758"
tell application "System Events"
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
tell application "System Events"
tell process "Safari"
keystroke " "
end tell
end tell
end if
else if name of the current menu item of popup button "NewPostOptions_Apple_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "Customizing" then
is_App_Active()
apple_logon()
tell application "Safari"
activate
set URL of document 1 to appleMakeNewPost & "751"
tell application "System Events"
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
tell application "System Events"
tell process "Safari"
keystroke " "
end tell
end tell
end if
else if name of the current menu item of popup button "NewPostOptions_Apple_where" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is "Scripting" then
is_App_Active()
apple_logon()
tell application "Safari"
activate
set URL of document 1 to appleMakeNewPost & "724"
tell application "System Events"
tell process "Safari"
keystroke subject_text & " " & post_text
end tell
end tell
end tell
if state of cell "No" of matrix "NewPostOptions_enterafter" of tab view item "options" of tab view "tabgroup1" of window "newpostwindow" is on state then
tell application "System Events"
tell process "Safari"
keystroke " "
end tell
end tell
if then
end if
end if
end if
else
end if
end if