Applescript: Question

Trillian

Useless Icon Porter
've been working on a project that is themable, and I've almost goten the hang of AppleScript as far as what I want the App's functions to be, but as far as the UI goes, I've hit a wall.

The UI needs to be able to accept themes (which do not have a fixed widget placement). Some other things I need to be able to do is :

Alpha Masks
non-rectangular click regions
Animation support in the form of .png .tiff & .gif
Custom fonts


How much of this is even possable to do with Applescript? I'm sort of learning as I go, so I'd prefer to only have to learn apple script, and not have to intergrate this in with another language. Any good websites you guys could point me twoards? (or a faily cheap book, money is reather tight...)
 
I can't absolutely swear to it, but I feel 90% certain in saying that plain vanilla, out-of-the-box Applescript can't do most of those things. Possibly custom fonts, but the rest I seriously doubt.

On the other hand, you'd be able to do more of that stuff if you look into Applescript STUDIO, available through the Apple developer tools. You'd still be coding in Applescript, but Studio definitely affords you a far greater degree of control over your User Interface, including nice GUI tools to create custom windows, menus etc. If in addition you can consider using C or ObjC to create some custom controls, it would vastly expand your options.

This would allow you a fair degree of 'theming' at "design time". If you want the users to be able to apply themes at RUN time, that's a whole different ball game.
 
This may sound like a rather dumb question, but how exactly do I get at Applescript Sudio? I've looked at xcode, but I just see a templete for a regular Applescript app. I'm rather interested in it, it would be nice to be able to this as themeable as panic's audion, with just Applescript Studio.

:\
 
IF you develop an Applescript application in Xcode, that basically IS being "in Applescript Studio." Applescript Studio (I guess we'd best not abbreviate that, eh?) is basically developing a cocoa-type application, but using Applescript as the language. You create windows in Interface builder, put GUI elements into them, connect their events to each other and attach scripts.

I will confess that I have not written an Applescript studio app, though I have read about them. Get the scoop here:

http://www.apple.com/applescript/studio/
 
Yeah, I just noticed that it would be a cocoa-type application. Do all cocoa applications have to have the widgets that IB uses? I was hoping that it could have skins like this:

some_bhodinut_preset.png
(for lack of a better example I went and barrowed one from audion.)

Or would this be where C comes into play?

-befudled (is that even a word?) trillian
 
Honestly, yeah, some C or ObjC might be helpful there. I believe XCode allows you to take an arbitrary bitmap and make a basic single-click BUTTON out of it fairly easily, but if you want a control with more complex behavior, some coding will be required.

Working at that level (overriding the appearance and behavior of cocoa UI elements) is exerting control at a level a considerably finer than you would normally use Applescript for. Look at the NSControl class (http://developer.apple.com/document...s/NSControl.html#//apple_ref/occ/cl/NSControl) in the Cocoa documentation for the nuts & bolts of this sort of programming. You would need to subclass that Cocoa class - and hand-code all pertinent methods - to create a customized control.

That said, I can't swear there's no shortcut way to do it. There are OS X themes you can install (not Apple-sanctioned, I hasten to add) which override most, if not all, standard UI elements, so that existing OS X programs use the new versions. I imagine someone might create a package of customized widgets that can be used in XCode, regardless of whether you were coding in Applescript or ObjC.

So basically, this is probably a little too sophisticated for 100% Applescript, but I wouldn't stake my life on it.
 
Back
Top