Re: AppleEvents: Send port for process has no send right, port=( port:37207/0x9157 rcv:1,send:0,d:0 limit:5) (findOrCreate()/AEMachUtils.cp #526)

2015-11-23 Thread has
John MacMullin wrote: > Anyone have an idea of what is causing this message in the log file? > > AppleEvents: Send port for process has no send right, port=( port:37207/0x9157 rcv:1,send:0,d:0 limit:5) (findOrCreate()/AEMachUtils.cp #526) Nope, although you're obviously no

Re: Scripting Bridge Question

2015-10-26 Thread has
If so, you won't be the first person who's had to fall back to AS for some things, or just abandon SB completely. HTH has ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to th

Re: Scripting Bridge Question

2015-10-26 Thread has
two statements: Scripting Bridge doesn't work properly; never has, never will. According to the Apple developer that wrote it, it wasn't designed to work with Carbon apps (which is funny cos it doesn't work right with Cocoa ones either). Maybe your AS code will translate; maybe it won&#x

o Swift generics, y no can I haz u dispatch correctly?

2015-09-27 Thread has
ticularly - after all, this is a great opportunity to kick its tyres and figure how to make it more robust and less ornery.) Many thanks, has † This damn project is taking me far too long to complete, and it's got me cursing Swift as much as I curse AppleScript (and that is a LOT of curs

[postscript] Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-14 Thread has
Quick follow-up for anyone interested... On Sep 8, 2015, at 5:45 PM, has <mailto:hengist.p...@virgin.net>> wrote: I will need to spend some more time building it out and testing it, but (touch-wood) it looks like the problem might be cracked at last. Wahey! So, my first attempt t

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-08 Thread has
On 08/09/2015 23:06, Charles Srstka wrote: On Sep 8, 2015, at 4:43 PM, has <mailto:hengist.p...@virgin.net>> wrote: Yeah, the goal is for each app-specific glue to subclass the concrete library classes (which provide the query-building and AE dispatch services using raw four-char c

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-08 Thread has
On 08/09/2015 16:38, Charles Srstka wrote: On Sep 8, 2015, at 4:18 AM, has <mailto:hengist.p...@virgin.net>> wrote: But after adding a protocol to supply this information, SourceKit and swiftc crash upon reading the code:[...] That’s true; however, adding a second “YourObjectProt&

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-08 Thread has
now: forget about generics-based reusability, and just duplicate (ugh) all the base methods within the code-generated glues and put the correct signatures on those. What matters most is that the UX works; code purity will just have to wait. Many thanks to all, has _

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-08 Thread has
() } class MyObject { required init() {} func foo() -> T { T() } } class YourObject: MyObject, Object { required init() {} } let obj = YourObject() As suggested, I'm going to write these up as a radar ticket. Thanks, has __

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-08 Thread has
t the type system syntax as used in your protocol needs to be more expressive, allowing you to to say 'all results ⊆ all Things'. I'm not a type theorist though. You might be better off asking over on the Lambda the Ultimate forums (http://lambda-the-ulti

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-06 Thread has
On 05/09/2015 07:07, Charles Srstka wrote: On Sep 4, 2015, at 7:59 PM, Quincey Morris <mailto:quinceymor...@rivergatesoftware.com>> wrote: On Sep 4, 2015, at 16:31 , has <mailto:hengist.p...@virgin.net>> wrote: At risk of derail... Do you mean “derail” or “detail”? I feel

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-04 Thread has
On 03/09/2015 19:57, Quincey Morris wrote: On Sep 3, 2015, at 11:16 , has <mailto:hengist.p...@virgin.net>> wrote: * Using an instance as a factory for its own class is contrary to general usage, so is a smell at best. It’s a job for a class func. No, it's fine. It's for a

Re: Swift generics, circular type declarations, and segfaults, oh my!

2015-09-03 Thread has
On 03/09/2015 17:05, Fritz Anderson wrote: On 3 Sep 2015, at 8:55 AM, has wrote: Stuck and looking for ideas here. I need to define a base class whose methods vends instances of its subclasses (thus enabling chained method calls; your basic query builder). I’m assuming Swift 1.2. The

Swift generics, circular type declarations, and segfaults, oh my!

2015-09-03 Thread has
init() { } func makeNewObject() -> ObjectBase { return self.dynamicType.init() } } class MyObject: ObjectBase { required init() { } func foo() { print("foo") } } print(MyObject().makeNewObject()) // result is new MyObject instance (Yay!) MyObject().mak

Re: [PSA] native AppleScripting support for Swift

2015-07-15 Thread has
Quick postscript: I've now posted AppleEventBridge's Swift documentation online for easier perusal: http://hhas.bitbucket.org/ It's still a bit rough, natch, but it should give a good idea of what it does and how it works without having to pull the project fi

Re: [PSA] native AppleScripting support for Swift

2015-07-15 Thread has
Hi Alex, Thanks for the kind words. I know AEB's off to a hopeful start: I've been using appscript professionally for high-end automation for years[1], and hundreds (thousands?) of other appscript users have beaten the tar out of it over the years too, so the design has already prov

[PSA] native AppleScripting support for Swift

2015-07-13 Thread has
le thing to a production-quality 1.0 release before the end of the year. Enjoy, and I look forward to hearing what you think. has ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: NSAppleEventDescriptor docs [was: Re: [Swift] best way to support 'keyword' args,...]

2015-06-16 Thread has
xas.edu/~wcook/Drafts/2006/ashopl.pdf The usual way to add AE handling to a Cocoa app is to use the Cocoa Scripting framework. It has flaws, but unless you've a specific reason not to use it then it's probably the least painful option currently available. (If I ever get a spare year wi

Re: [Swift] best way to support 'keyword' args, symbolic values, show values as literals?

2015-06-16 Thread has
On 15/06/2015 18:39, Quincey Morris wrote: On Jun 15, 2015, at 10:17 , has <mailto:hengist.p...@virgin.net>> wrote: the goal is to enable a user to print an object specifier and be able to copy-and-paste that straight into another script - i.e. `-description` should always return

[Swift] best way to support 'keyword' args, symbolic values, show values as literals?

2015-06-15 Thread has
ibutes: textedit.make(args: [ TESymbol.new: TESymbol.document, TESymbol.withProperties: [TESymbol.text: "Hello World"], TESymbol.timeout: 30]) or: textedit.make(args: [ "new": TESymbol.document, "withProperties": [

Re: Optionals? A better option!

2015-05-15 Thread has
pesystem: just a handful of compiler directives for allocating memory on the stack. If your only experience is in C and its descendents, you're simply not qualified to discuss type system design. Go learn a language like Haskell or ML that has a real type system; it'll open your eyes. Ty

Re: Running AppleScripts from an App using NSAppleScript

2015-04-28 Thread has
Dave wrote: > I have a number of AppleScripts I’d want to run from my App. Each Script has a couple of parameters [...] Example code here: http://appscript.sourceforge.net/nsapplescript.html The downside (one of them anyway) is that you have to do all of the Cocoa<->AE pa

Re: NSAppleScript Problem

2015-03-31 Thread has
ttp://appscript.sourceforge.net/asoc.html HTH has ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Upd

Re: prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread has
On 16/03/2015 22:02, Ken Thomases wrote: On Mar 16, 2015, at 4:50 PM, has wrote: Quick question as I'm guessing the answer is "no", but I've a UIAgent that floats an NSPanel above other apps and I'm wondering if there's any way to avoid 1. having to click

prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread has
code into AI if possible as it's crashy enough without my shoddy C* code destabilizing it further.) Thanks, has [1] Screen recording if it helps illustrate the problem: <http://mantasystems.co.uk/placepackcopy-720.mov> (22MB) ___ Cocoa-d

Re: building an AppleScript editor app

2014-12-07 Thread has
sqwarqDev wrote: > it's a hobby. "The Aristocrats!" > Wasting my time on this is no worse than watching re-runs of "Kung Fu" and sure beats suffering on the sofa watching Leeds United getting hammered again... :( (Bradford City FTW) >> Or you u

Re: building an AppleScript editor app

2014-12-07 Thread has
rbon OSA (OpenScripting) framework has been a legacy API since 10.6, and some functions also require deprecated types such as FSRef in addition to Component/ComponentInstance. OSAKit framework is supposed to be a Cocoa alternative, but is an undocumented sack of crap, and you still have to drop down to

What Apple event functionality is still missing from Cocoa?

2014-11-11 Thread has
g in my implementation. I'm also open to advice on how to best present and document this code to make it as quick and painless for Apple to implement (I figure the less effort it is for them, the likelier they are to include it in [ideally] 10.11). Thanks, has p.s. Anyone know if ha

Re: [PSA] JavaScript for Automation

2014-09-04 Thread has
don’t think that it will be a priority anytime soon. The Automation team already has its own manager, developers, and budget, so aren't affected by OS X's other problems. That’s not to say that I don’t think that Apple should delay it; I’m just saying that I have doubts that it will ha

[PSA] JavaScript for Automation

2014-09-01 Thread has
[I'm cross-posting this from the AppleScript Users mailing list - it's not a Cocoa question, but quite a few developers are extremely interested in alternatives to AppleScript for application automation so I believe it has relevance. I don't wish to risk the Cocoa Dev list mom

Re: Class OC_PythonObject: no such selector: _cfTypeID

2010-06-04 Thread has
ugh you could always submit a feature request asking for more 'intelligent' error reporting from the bridge in response to known common user errors such as forgetting the trailing underscore in PyObjC, e.g.: "no such selector: _cfTypeID (did you mean _cfTypeID_?)". HTH has

Re: Simulating app termination

2010-06-01 Thread has
ems that you don't get even basic > Applescript support for free anymore, so I have to add it. If your application runs off a Cocoa event loop, it ought to respond to a standard 'quit' event; all GUI processes should. If not, maybe there's something not quite right

Re: ScriptingBridge Commands

2010-05-05 Thread has
significant proportion of your users will be using SB then I recommend you supply supplementary documentation that shows them how to write these commands correctly, also noting that sdp-generated headers define these method names incorrectly so that ObjC users will kn

Re: ScriptingBridge Commands

2010-05-05 Thread has
John Nairn wrote: > I have been using ScriptingBridge to script my AppleScriptable Cocoa > app using Python and Ruby. Today I noticed that commands defined on > the main application do not work with error message that the > application has no such attribute. I checked the

Re: Scripting Bridge for GUI scripting?

2010-04-29 Thread has
Louis-Philippe wrote: > I am looking around and I can't find docs about GUI scripting from the > Scripting Bridge... it seems like NSAppleScript would do it, but I would > like it better if I could do it with objective-c logic. Anybody has worked > around something like that

Re: AppleScriptability Meets NSOperation

2010-03-29 Thread has
. That's no good, especially if an error > occurs -- the script has already moved on. The Apple Event Manager supports suspend and resume, but I have no idea if you'll be able to take advantage of this feature in your application; I suspect it'll largely depend on how your scrip

Re: Messaging Cocoa apps through Terminal

2010-03-03 Thread has
e-dangers-of-distributed-objects/ but if you understand and can work within its limitations, it's a very quick and easy way to get 'low-level' access to the known innards of Cocoa apps. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http:

Re: Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?

2010-02-21 Thread has
] }> > > As you can see, the desired keys and values are all in there. How can I get > them out? (Spent an hour reading documentation to no avail.) ObjC-appscript has an AEMCodecs class that includes code for packing and unpacking AppleScript-style records, if you don't mind

Re: How to access iTunes using cocoa

2010-01-26 Thread has
] > > Would this actually matter in reality, though? > > A quick experiment (on my 2006 Mac Pro) indicates that CFMessagePort > has a round-trip latency of roughly 100us, and with 1MB messages can > transfer about 500MB/sec. > > On a more emperical level, some apps use

Re: How to access iTunes using cocoa

2010-01-26 Thread has
Jens Alfke wrote: > On Jan 26, 2010, at 11:13 AM, has wrote: > >> The Apple Event Object Model was optimized for System 7, where IPC >> was extremely expensive > > I know; I was on the AppleEvents engineering team at the time :) > > IPC is still extremely expen

Re: How to access iTunes using cocoa

2010-01-26 Thread has
Jens Alfke wrote: > On Jan 26, 2010, at 9:41 AM, Paul Sanders wrote: > >> I use Cocoa's NSAppleScript class. This seems to work fine on Tiger, Leopard >> and Snow Leopard. > > Yup, it just has the limitation that you have to run the script > synchronousl

Re: Bundle and window server interaction

2010-01-18 Thread has
nteraction = -1713. > Ideally I would like to examine my AppleScript for the presence of syso/dlog > et al and transform it accordingly. > Searching has revealed that "a custom send proc" might be suitable. > Ignorance prevents me from proceeding further. > The goal is: >

Re: Bundle and window server interaction

2010-01-18 Thread has
OSStatus err = 0; ProcessSerialNumber psn = {0, kCurrentProcess}; err = TransformProcessType(& psn, kProcessTransformToForegroundApplication); (This is what rb-appscript calls the first time a standard GUI-less ruby process tries to display a Standard Additions dialog.) HTH has -- Control

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread has
On 5 Jan 2010, at 21:41, Jesse Grosjean wrote: > Last, how would I go about sending Cmd-C/Cmd-V keystrokes directoy to > another application? Haven't done it myself, but I would guess CGEventCreateKeyboardEvent() and friends would be simplest. HTH has -- Control Appl

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread has
Jesse Grosjean wrote: > I'm developing a small open source app called QuickCursor. [...] Services no good? Only alternative I can think of would be to send Cmd-C/Cmd-V keystrokes, and hope that the user has the right text selected at the time. has -- Control AppleScriptable appl

Re: Scripting Bridge running method passing an array

2009-10-30 Thread has
On 30 Oct 2009, at 21:38, Kyle Sluder wrote: On Fri, Oct 30, 2009 at 2:35 PM, has wrote: No, the OP's code is passing a *single* reference that identifies *all* of the speaker objects that match the specified condition. No. Here is the OP's code: NSArray *set

Re: Scripting Bridge running method passing an array

2009-10-30 Thread has
d anywhere else. None of the material on Apple's developer site does a remotely competent job of explaining the key concepts behind Apple event IPC and the Apple Event Object Model, IMO, so don't bother looking there. Regards, has -- Control AppleScriptable applications from Pytho

Re: NSAppleScript error

2009-09-06 Thread has
it's a general AppleScript query, you will have most luck posting it to applescript-users as that's where most of the AppleScripting experts reside. http://lists.apple.com/mailman/listinfo/applescript-implementors http://lists.apple.com/mailman/listinfo/apples

Re: Scripting Bridge and multiple attachments

2009-09-01 Thread has
restrictions on how object specifiers and events can be constructed via glues, so I suspect the only way you could do it there is by messing around with raw AE codes. (My opinions on SB are pretty well recorded though, so I'm not going to go

Re: AppleScript Record and NSDictionary

2009-07-22 Thread has
record keys in your NSDictionary, use AEMType instances to signify AppleScript-defined property names, and NSStrings for user-defined identifiers. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net __

Re: sending email form Cocoa app using Mail

2009-04-15 Thread has
Reza Farhad wrote: I want to update my app from using NSMailDelivery to using scripting Bridge with Mail to take care of all my emailing from my Cocoa app. I just have this question, what happens if the user is not using Mail and has only setup an alternative email client such as entourage

Re: Best Strategy to Control iTunes

2009-04-03 Thread has
available, and a MacRuby version is under development.) Pros: - Mature design has been heavily field-tested and refined over the last five years, so application compatibility is very nearly on par with AppleScript and functionality is equal or better (e.g. thread support). - Open-sour

Re: Best Strategy to Control iTunes

2009-04-01 Thread has
On Apr 1, 2009, at 3:57 PM, Sean McBride wrote: On 4/1/09 12:25 PM, has said: ObjC-appscript is almost entirely thread-safe. You'll need to watch when using methods that rely on the Carbon Process Manager (some initializers, -isRunning) as the PM APIs don't appear to be thread- s

Re: Best Strategy to Control iTunes

2009-04-01 Thread has
whilst iTunes has dialog windows opened, the command will be automatically enqueued. Â In other words, your tracks will be added after the user closes the dialog window. Â Run the script in a separate thread so it won't block your application's interface in any case. No, don

Re: Send events to AppleScript

2009-03-21 Thread has
AppleScript) is to be able to receive notifications from Word when, for example, the user has hit a certain key combination, to know where the insertion point (or selection) is in Word and to receive notifications when it moves, to be notified when a user is trying to edit something and

Re: Send events to AppleScript

2009-03-20 Thread has
On Mar 21, 2009, at 1:06 AM, Тимофей Даньшин wrote: On Mar 21, 2009, at 3:34 AM, has wrote: Is it at all possible to have an application send actions to a particular AppleScript script, Yes. See NSAppleScript/OSAKit/Carbon OSA APIs. There's a sample project in the objc-apps

Re: Send events to AppleScript

2009-03-20 Thread has
ch you'll need to build yourself, but is more capable, compatible and portable, and doesn't obfuscate everything to heck. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Coc

Re: Termination Running Applications ...

2009-03-18 Thread has
an error number, e.g. userCanceledErr err = AEGetParamDesc(&res, keyErrorNumber, typeSInt32, &errDesc); if (err == noErr) { AEGetDescData(&errDesc, &err, sizeof(err)); AEDisposeDesc(&res); } else if (err == errAEDescNotFound) err = no

Re: Get the list of Places in Finder?

2009-03-18 Thread has
tely. You could try scraping Finder's preferences file (this info must be stored somewhere, most likely as serialised AliasHandles), or manipulating its GUI via the Accessibility APIs/GUI Scripting. Both would be hacks, however, and prone to breakage, so YMMV. HTH has -- Con

Re: Calling Script Objects in Applescript

2009-03-14 Thread has
example project, CallAppleScriptHandler, in the objc-appscript repository that shows how to do most of this. BTW, best place for these sorts of questions is applescript- implementors: http://lists.apple.com/mailman/listinfo/applescript-implementors More focused, less crowded. HTH

Re: preparing HTML email content for Mail.app like safari does

2009-03-07 Thread has
sers mailing list as that's where you'll find most experienced Mail scripters. http://lists.apple.com/mailman/listinfo/applescript-users HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net __

Re: Odd crash

2009-03-04 Thread has
] initWithContentsOfURL:url error:&errors ]; One point, which may or may not be related: as with **NSError arguments, you do not need to allocate an NSDictionary instance yourself. If there is an error to report, initWithContentsOfURL:error: will create it for you. HTH has -- Con

Re: sdp generating empty header

2009-02-20 Thread has
enefits such as being able to send events on background threads, better tool support and documentation (ASTranslate is particularly useful when you're starting out), and an API that doesn't obfuscate everything it does. HTH has -- Control AppleScriptable applicat

Re: Programatically Uncheck "Change Picture" In Desktop Settings?

2009-02-14 Thread has
EGlue/SEGlue.h" SEApplication *systemEvents = [SEApplication applicationWithName: @"System Events"]; SEReference *ref = [[systemEvents currentDesktop] pictureRotation]; id result = [ref setItem: [NSNumber numberWithInt: 0]]; HTH has -- Control AppleScriptabl

Re: Killall Finder Brings Hidden Apps To Front?

2009-01-13 Thread has
it be longer? Quitting an application and relaunching it immediately afterwards is a bit problematic as the 'quit' event will return before the application has finished terminating, with the result that you're trying to start up an application that's in the proc

Re: Any nice way to quit a background/helper app?

2009-01-10 Thread has
Sean McBride wrote: Is there a way to quit a background app, other than having NSTask send a unix 'kill' ? Yeah: you can call the function kill(). man 2 kill That's not a 'nice way', as requested in the subject. :) The nice way is to send a quit AppleEvent

Re: iTunes Scripting Bridge examples?

2009-01-05 Thread has
pleScript then I'd recommend getting a basic grasp on the beast - Matt Neuburg's 'AppleScript: The Definitive Guide' provides the best programmer-friendly guide to the language that I know of, and isn't shy of discussing the platform's many faults as well as its bene

Re: iTunes Scripting Bridge examples?

2008-12-30 Thread has
erface, best ask on applescript-users or go have a rake through <http://dougscripts.com/itunes > for existing examples. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Cocoa-dev

Re: Scripting Bridge and System Events

2008-12-27 Thread has
pg"]]; Dunno about Scripting Bridge - I have a fairly low opinion of it and avoid it myself. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Cocoa-dev mailing list (Cocoa-d

Re: Announce the time every 30 minutes

2008-12-12 Thread has
Mr. Gecko wrote: I'm trying to find out how to announce the time every 30 minutes, You could run 'say `date`' as a cron job. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___

Re: Writing a more usable AppleEvent logger

2008-11-17 Thread has
27;Event Log' pane uses): http://appscript.sourceforge.net/tools.html Mike Ash's AEVTBuilder might also be of some interest to you, being an ObjC version of the AEBuild* functions. HTH has p.s. None of this is specific to Cocoa, so might be a good idea to move future discussion to appl

Re: Calling a script with parameters failing with error -1708

2008-11-15 Thread has
Suite and kASSubroutineEvent. (e.g. There's an example project, CallAppleScriptHandler, in the objc-appscript repositorythat shows how to do this.) Though as you're using OSAKit and your subroutine takes positional parameters, you could just use -[OSAScript executeHandlerWithNa

Re: ObjC data structure for C++/ObjC++ objects?

2008-11-07 Thread has
pointers to objective C objects, however, and not to arbitrary objects. This seems like a simple thing to do but I am a bit stumped. Does anyone know of a way to do this? You could wrap your C++ pointers in NSValues and store those. HTH has -- Control AppleScriptable applications from Python

Re: Use PPPOE to load net

2008-11-05 Thread has
om/releasenotes/AppleScript/RN-AppleScript/index.html That'll only work on 10.5 and later. If the OP also needs to support 10.4 or earlier, they'd need to implement both and then check the OS version to decide which one to run. HTH has -- Control AppleScriptable applications from Py

Re: External Program Control from within Cocoa App

2008-11-03 Thread has
getting a copy of Matt Neuburg's 'AppleScript: The Definitive Guide', 2nd ed. [1] which provides a programmer-friendly introduction to AppleScript, and isn't shy about discussing the language's many flaws as well as its features. HTH has [1] Covers up to 10.4; ho

Re: Passing Variables to AppleScript

2008-10-19 Thread has
EGetDescData(&errDesc, &err, sizeof(err)); AEDisposeDesc(&res); } else if (err == errAEDescNotFound) err = noErr; return err; } Use -[NSWorkspace launchedApplications] to look up the application's process id based on its name. HTH has -- Control Appl

Re: Faceless background app that uses NSAppleScript

2008-10-16 Thread has
lications invariably require WM access as well). Past use of NSAppleScript has revealed that it's somewhat "quirky" about event handling, in that what looks like a blocking synchronous call (executeAndReturnError), seems to allow the event loop to keep processing while it

Re: Play Playlist in iTunes

2008-10-04 Thread has
me 1 = 2.116 sec time 2 = 82.634 sec I'm not sure which approach EyeTunes uses, but it's something to bear in mind if performance is an issue for you. I would prefer using AppleEvents because it is the right way to communicate with different things in the os, using cocoa. It&

Re: Python, Mac OS X 10.5.5 and CoreGraphics

2008-10-03 Thread has
#x27;s own Python installation.) That's the only thing I can think of offhand. If that's not it, you could also try asking for help over on the PythonMac-SIG mailing list: http://mail.python.org/mailman/listinfo/pythonmac-sig HTH has -- Control AppleScriptable appli

Re: Play Playlist in iTunes

2008-10-03 Thread has
-OO fashion (which is quite often). Regarding the playing of iTunes playlists, here's a quick attempt to clarify: iTunes has no 'play playlist' command as you suggest. There is, however, a 'play' command (Apple event), and various kinds of playable objects: sour

Re: Play Playlist in iTunes

2008-10-03 Thread has
ld probably hack one from its existing ObjC translator if you know any Python. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Play Playlist in iTunes

2008-10-02 Thread has
it = [[AEMApplication alloc] initWithName: @"TextEdit"]; AEMQuery *ref = AEMApp elements: 'docu'] at: 1] elements: 'cwor'] at: 1]; AEMEvent *evt = [textedit eventWithEventClass: 'core' eventID: 'getd'];

Re: Play Playlist in iTunes

2008-10-02 Thread has
s you'll need to build and bundle appscript yourself in any products you release (a fairly trivial task, and appscript's license is very liberal). But you pays your money, etc. HTH has [1] http://appscript.sourceforge.net/tools.html -- Co

Re: Finding the iTunes Music Library

2008-10-01 Thread has
in its scripting interface that can provide this information directly (although you could maybe kludge it), so you might not have much choice. Any particular reason you're wanting this stuff? HTH has -- Control AppleScriptable applications from Pytho

Re: sending email with attachement from cocoa

2008-09-26 Thread has
pt/objc-appscript/trunk objc-appscript I believe there's a sample project somewhere on Apple's site that shows how to do the same sort of thing using Leopard's Scripting Bridge (but I'll not link to that here as I don't have a very high opinion of Scripting Bridge:

Re: appleScriptWithContentsfFile wipes out Quark's Applescript dictionary

2008-09-22 Thread has
ed to define "wipes out" a bit more precisely. You might also want to try asking on the applescript-implementors list; I think you'll have a better chance of finding help there. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appsc

Re: NSOperationQueue

2008-09-20 Thread has
7;s trying to achieve, rather than focus on individual details of how he's currently trying to do it? That way, folks might be able to suggest a better overall solution, rather than getting bogged down in the details of the current, potentially misconceived, approach. HTH has -- Control

Re: EPS

2008-09-12 Thread has
Rep]; // do some stuff with the EPS image rep here... e.g. to write to file: [[epsRep EPSRepresentation] writeToFile: @"/Users/foobar/test.eps" atomically: NO]; [view release]; [pool release]; return 0; } HTH has -- Control AppleScript

Re: EPS

2008-09-10 Thread has
Illustrator and back. Depending on what you're doing, another option might be to draw your path directly in Illustrator using its Apple event ("AppleScript") interface. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.

Re: AppleScript on a Context Menu

2008-09-02 Thread has
"top-level". Anyone have an example on how to do this that doesn't involve Automator and will still create an AppleScript plugin? This the sort of thing you're looking for? http://free.abracode.com/cmworkshop/on_my_command.html HTH has -- Control AppleScriptable applicati

Re: Trouble with Scripting Bridge

2008-09-02 Thread has
pless tracks found.' ref = tracksref[its.gapless == False] if ref.exists(): pprint(zip(ref.album(), ref.id(), ref.gapless())) else: print 'No gapped tracks found.' (Bear in mind that the above may take a few seconds for extremely large playlists; depending on how y

Re: Objective-C and AppleScript

2008-09-01 Thread has
ery application process contains "Microsoft Excel") -- see ExcelAppActive below If you use objc-appscript (I won't suggest the sdef/sdp/Scripting Bridge toolchain as an alternative as I know it has problems with Excel), you can check if Excel is running by calling the ME

re: NSAppleScript shies away from porcupines

2008-08-27 Thread has
NSLog(@"%@", [error localizedDescription]); } [pool drain]; return err; } HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Cocoa-

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread has
ls using raw «data utxt...» format, or pass in unicode strings as parameters to an Apple event constructed via NSAppleEventDescriptor. has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net __

Re: ScriptingBrige InDesign

2008-08-18 Thread has
fit each language. You also get better documentation and developer tools - e.g. ASTranslate is especially useful if you need help in converting application commands from AppleScript to appscript syntax. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://

Re: Opening an external file in a external application

2008-08-16 Thread has
oa app would raise a NSAlert. Assuming you've figured out a way to uniquely identify your workbook element, you could poll Excel at regular intervals to see if it still exists. HTH has [1] Be aware that Office apps are a rather eccentric bunch even by AppleScripting standards,

Re: Accessing memory of another application?

2008-08-13 Thread has
. Use a formal IPC mechanism to communicate between two processes. There's an overview of available options at: http://developer.apple.com/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemTechnology/chapter_3_section_5.html HTH has -- Control AppleScriptable applications f

Re: Should I retain a variable returned from this accessor?

2008-08-13 Thread has
ter. (The one parameter that's always required is 'new'; others may be optional or required depending on the application implementation, type of object being created, etc.) As soon as you pass this object to -addObject:, a 'make' event containing those parameters is s

Re: Opening an external file in a external application

2008-08-12 Thread has
et engines and Excel file importers/exporters. Really though, what's best/practical/possible all depends on what you're trying to do, so if you want more advice then you'll need to provide more information. HTH has -- Control AppleScriptable applications from Pytho

Re: NSDistributedNotifications and scripting languages

2008-08-04 Thread has
are a general broadcast mechanism, used to announce that something of interest has happened when you don't know or care who's listening. If you're looking for point-to-point or two-way communication, there are other, more suitable, IPC mechanisms for that. AppleEvents are the

  1   2   >