AppleScript and Project Builder help

Posted:
in Genius Bar edited January 2014
Ok I am having trouble with this AppleScript. I have a button in an interface I made and I want to link the follwing AppleScript to it. So then it adds "on mouse up theObject event theEvent" at the begining and "end mouse up" and the end. So the problem is this... This works fine with a regular AppleScript but all of mine are internet services... here is what I think the problem is... in project builder when I click anything but the things in red i the little menu it says "on mouse up" but when you click the ones that say PROPERTY (Red) then it says that property instead of "on mouse up" and project builder wont let me put "on mouse up theObject event theEvent" in front of the properties it then says that it needs to end... i think that is becasue the properties change on those thing in red and it cant becaseue it still needs "on mouse up" ad the property. SO HOW DO I FIX THIS... does anyone know... all help is very apreciated... thanks.... here is the script





on mouse up theObject event theEvent

WSDL URLthttp://services.xmethods.net/soap/ur...ed-quotes.wsdl _

(IBM WSDL Toolkit 1.1 - compatible version)

*)



-- SET THE DEFAULT VALUES

property SOAP_Endpoint_URL : "http://services.xmethods.net:80/soap";

property SOAP_app : "soap"

property method_name : "getQuote"

property method_namespace_URI : "urn:xmethods-delayed-quotes"

property SOAP_action : ""




-- QUERY USER FOR THE STOCK INDICATOR

set this_text to "AAPL"

repeat

try

display dialog "Stock Quote" & return & return & ¬

"Enter the company code:" default answer this_text

set this_text to the text returned of the result

exit repeat

on error number error_number

if the error_number is -128 then error number -128

beep

end try

end repeat



-- CREATE THE PARAMETER RECORD

set the method_parameters to {Symbol:this_text}



-- CALL THE SOAP SUB-ROUTINE

copy my SOAP_call(SOAP_Endpoint_URL, method_name, method_namespace_URI, method_parameters, SOAP_action) to {call_indicator, call_result}

if the call_indicator is false then

beep

display dialog "An error occurred." & return & return & call_result buttons {"Cancel"} default button 1

else

display dialog "The delayed stock quote for " & this_text & " is: " & call_result buttons {"OK"} default button 1

end if



on SOAP_call(SOAP_Endpoint_URL, method_name, method_namespace_URI, method_parameters, SOAP_action)

try

using terms from application "http://www.apple.com/placebo";

tell application SOAP_Endpoint_URL

set this_result to call soap ¬

{method name:method_name ¬

, method namespace uri:method_namespace_URI ¬

, parameters:method_parameters ¬

, SOAPAction:SOAP_action}

end tell

end using terms from

return {true, this_result}

on error error_message number error_number

if the error_number is -916 then ¬

set the error_message to "The script was unable to establish a connection to the Internet."

return {false, error_message}

end try

end SOAP_call

end mouse up

Comments

  • Reply 1 of 2
    macusersmacusers Posts: 840member
    I got the information off another website.. thanks anyway if anone wanted to help
  • Reply 2 of 2
    neutrino23neutrino23 Posts: 1,562member
    Quote:

    Originally posted by MacUsers

    I got the information off another website.. thanks anyway if anone wanted to help



    What was the fix?
Sign In or Register to comment.