• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Executing short AppleScript command sets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing short AppleScript command sets


  • Subject: Re: Executing short AppleScript command sets
  • From: Jeffrey Mattox <email@hidden>
  • Date: Sat, 29 Mar 2003 19:48:00 -0600

The lack of examples in the Apple docs is truly amazing. I'm stuck.

Starting with this AS:

tell application "Netscape"
URL of window 1
end tell

I get this AEPrint output from Script Debugger:

ascr\tell{
----:psn ($00000000002E0001$)
} core\getd{
----:obj {
form:'prop',
want:'prop',
seld:'curl',
from:obj {
form:'indx',
want:'cwin',
seld:1,
from:'null'()
}
},
&csig:65536
} ascr\tend{ }
How do I put that mess into an event descriptor?? I've started, but get completely flummoxed on the parameters:

-(void)executeAE {
AppleEvent event, reply;
OSErr err;
OSType addrNetscape = 'MOSS';

err = AEBuildAppleEvent
('core', 'getd', typeApplSignature, &addrNetscape,
sizeof(addrNetscape),
kAutoGenerateReturnID, kAnyTransactionID, &event, NULL,
"'----':obj(@@)", ??); // not finished!!

err = AESend(&event, &reply, kAEWaitReply, kAENormalPriority,
kAEDefaultTimeout, NULL, NULL);

AEDisposeDesc(&event);
AEDisposeDesc(&reply);
return;
}

I guess AEBuildParameters() is supposed to help me, but without an appropriate example, I have no idea how to use it.

Jeff


At 6:06 PM -0600 3/27/03, Nate Alf wrote:
Send apple events:

http://cocoa.mamasam.com/COCOADEV/2002/05/2/34881.php

(Eeek - I think I will take the speed hit before managing that mess in my code..)

Nate

Tech Note 2045: http://developer.apple.com/technotes/tn/tn2045.html



On Thursday, March 27, 2003, at 01:41 PM, Jeffrey Mattox wrote:

Thank you to all who replied on and off list to this. It appears this is a popular task.

I've done some experiments, and I find that "executeAndReturnError:" takes considerable time to run. There must be compile steps in there. Is there a way to turn a script into, say, Apple events, and then execute those faster? Perhaps by running an AppleScript script somewhere and capturing the compiled commands, whatever?

If so, please use my example (tell application "Finder to do something simple).

Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Is there a ready chart plotting view?
  • Next by Date: Re: Is there a ready chart plotting view?
  • Previous by thread: Re: Executing short AppleScript command sets
  • Next by thread: Component Manager Message...
  • Index(es):
    • Date
    • Thread