Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Creating Cocoa objects within Applescript possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating Cocoa objects within Applescript possible?



Hi

I wrote a Cocoa class that enable the easy query of PHP scripts but am finding that when I switch over to AppleScript, I can't figure out how to initialize it.

In Cocoa it is initialized like this

NSURL *url = [NSURL URLWithString: @"http://path/to/php/script.php";];
PHPInvcation *invocation = [PHPInvcation invocationWIthURL: url];

I tried to do something similar in AppleScript but am stuck on how to create Cocoa objects from within it. Here's what I tried so far:

property invocation : ""

on clicked theObject
if the name of theObject is "doSearch" then
if (invocation = "") then
set url to call method "URLWithString" of class "NSURL" with "http://localhost/Test/TestPHPScript.php "
--set invocation to call method "invocationWithURL" of class "PHPInvocation" with url
end if
--set x to get_page_record
call method "uppercaseString" of (contents of text field "inputField" of window "myWindow")
end if
end clicked


When I go to build the project however, I'm getting the following compile error

Expected “into”, variable name, class name, other parameter name or property but found “"”. (-2741)

Is it even possible to create new Cocoa objects within AppleScript and if so, how does one go about doing it?

Thanks for any help



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.