Looking for AppleScriptObjC Explored – Converting an AppleScript Studio App to ASObjC

I’m trying to find where I can buy a copy of “AppleScriptObjC Explored”.

I bought “Everyday AppleScriptObjC”, but it doesn’t contain the tutorials and sample projects I’m looking for.

I’m thinking about updating one of my 20 year old AppleScript Studio apps and need to learn the basics beyond the simple Xcode ASOC tutorials I’ve found on YouTube.

Things I’m doing in Studio that I cannot figure out or don’t know where to start with ASOC:

  • Create a toolbar, attach it to a window, add items, specify default items, respond to clicks on toolbar items.
  • Make a new data source, attach it to a multi-column sortable table, populate the data source with a list of records, respond to row selection changes and double-clicks.
  • Delete all items from a popup menu, add items to a popup menu from a list of strings, respond to popup selection change.
  • Display and close panels and drawers attached to a window.
  • Start/stop and display/hide progress bars and spinners.
  • Enable/disable push buttons and menu items.
  • Respond to drag and drop event: image dropped on an image well.

In ASOC I’ve figured out (using others’ tutorials here and on YouTube) how to get/set text in a text field and respond to button clicks, but beyond that I’m lost. I was able to do everything on my list in Studio using Apple’s excellent reference and sample code which seems to be nonexistent for ASOC.

My app’s main window, toolbar and preferences dialog:

Ask @Shane_Stanley – I think it is not an impossible wish.

Also – I wrote an ebook about AppleScript programming on Xcode, and it describes how to operate on Xcode v14.x.

I discontinued AppleScriptObjC Explored mainly because too many complicated ASObjC Xcode projects ended in grief. Simpler stuff generally worked fine, but as people inevitably expanded them sooner or later memory issues would result in unexpected crashes. I felt I couldn’t in good conscience keep encouraging people to invest their time in it.

2 Likes

Shane’s words are based on his own experiences. I belive Shane.
But it sounds “swear at the kan”…Japanese old saying “羹に懲りて膾を吹く”.

AppleScriptObjC on Xcode is not so good not so bad.
AppleScript Studio conversion app may be not so bad. It has static UIs and using simple GUI elements.
AppleScriptObjC app like Objective-C using class inheritance will be bad.
NSDocument based project should be a bad experience.

Today, I develop and sell some AppleScriptObjC based applicaiton on Mac App Store, they have not so bad stability.

2 Likes

Yes, it very much depends on what the app does. Some work absolutely fine.

I think what put me off most was seeing people add some needed functionality that caused problems, to then realise they’d learned it all almost in vain.

1 Like

Yes. Some AppleScriptObjC app seems too greedy. AppleScriptObjC app have to keep simple and small function.

In this case, @jeffjungblut 's AppleScript Studio based app seems…hmm…there is need to re-form UIs.

Drawser was deprecated and some UI Element (floating palette?) have to change.

Controlling other app is a key point to convert to AppleScriptObjC project.

AppleScript Studio and AppleScriptObjC enviroment are quite different.
Mac OS X 10.4 era’s environment and current macOS Vist…Ventura environment are quite different from security point of view.

If @jeffjungblut got “AppleScriptObjC Explored” as-is, he or she will be able to get some knowledge about it.

Thanks Shane. Can I still buy a copy somewhere or direct from you?

I’m stuck at this point with my Studio apps. They all run on Leopard through Monterey but obviously I can only edit the UI in Xcode 3.x. The project will build in Xcode 9.4.1 but not under Xcode 13.4.1 or 14.1. I don’t have a compatible Mac to test builds in Xcode 10/11/12.

In Xcode 13/14 the AppleScript compiler doesn’t recognize any Studio-specific terminology even though the framework is there in the project and still supplied in macOS. My apps built for Intel still run, they just can’t be compiled. Declaring the framework at the top with use framework “AppleScriptKit” didn’t help.

If there exists a version of Xcode in between 9 and 13 that can build Studio apps and compile natively for Apple Silicon, then that’s 98% of all I really need, as my goal is to have a native Apple Silicon build for when the day comes that Apple releases a macOS version that no longer supports Intel.

My app’s UI has ~150 objects and the script is about 2500 lines. So the thought of rewriting most of it to use properties, connections and bindings for no new benefit except native Apple Silicon support has me wavering on if conversion to ASOC is a project I want to even bother with.

Skimming through Everyday AppleScriptObjC, I did find useful info on using native regex to do find/replace, which I need to implement anyway to replace calls to Satimage.osax, which doesn’t load under Monterey. (I’m aware there are workarounds but I haven’t tried them.) So that bit alone was worth the $15 :slight_smile:

1 Like

Thanks. Yes, the app’s drawer can be made a separate window instead, no problem.

Did something change with floating palettes? My toolbar window is set to float over all apps and it still works in Monterey.

I’ve been running my app on Monterey so I know of the security problems. Besides not recognizing OSAX, it gives a bunch of annoying permissions alerts about Finder, QuarkXpress, Photoshop, Interarchy, the desktop folder, etc. But those are just one-time nuisance alerts that don’t prevent the app from working. The only function I’m using in an OSAX can be replaced with ObjC calls.

As long as you’re aware of the limitations, sure. I have to eat :wink: . Just be aware that you won’t be converting your UI – you’ll be rebuilding it (unless you can find an old Mac).

Email me if interested.

1 Like

Did something change with floating palettes? My toolbar window is set to float over all apps and it still works in Monterey.

Mac App Store may reject deprecated UIs such as drawer and…some old style UI such as floating palette. But this app seems not a Mac App Store app.

Keynote.app had some floating palette in earlier releases. Now, it does not have floating palette.

Calling GUI apps from AppleScriptObjC app will cause a lot of security problems.

“load script and run” method is far from Script Editor runtime application.

The most stable way to run GUI app controlling method was using OSAScriptController and OSAScriptView like this.
http://piyocast.com/as/archives/3220

Thanks, I appreciate your advice. My app isn’t for sale, I’m just looking to keep it buildable and running native on Apple Silicon since Studio apps will no longer compile. They compile in Xcode 3, 8 and 9 but not in 13 or 14. I don’t have a Mac with Catalina to test Xcode 12. I doubt they’ll compile, but if they did then I wouldn’t have to do anything with ASObjC :slight_smile:

I recommend to full re-make on Xcode 14. Now, Xcode 14 does not have AppleScriptObjC app template, you can recover it by downloading my AppleScriptObjC App template from my blog.

http://piyocast.com/as/archives/15582

I thought Xcode 4.x or later can not build AppleScript Studio app due to its SDEF file is changed. AppleScript Studio related words are removed.

I did not know about Xcode 8 can build AppleScript Studio project.

You cannot edit the NIB in Xcode 4 or later without losing the AppleScript data but projects still recompile and build successfully up through (at least) Xcode 9.4.1 on High Sierra if you leave the NIB untouched. So you can still update scripts and rebuild when needed, but to edit the NIB you would need to go back to Xcode 3.

Also, the NIB needs to be saved in NIB 3.x format; Xcode 8 & 9 give a build error if it’s in XIB format: “This file is set to build for a version older than the deployment target. Functionality may be limited” (limited as in the app will launch but the UI does not respond at all).

1 Like

I love AppleScript, ASOC, and ScriptingBridge, but for an app with this much UI, network access, etc., I would seriously consider jumping to SwiftUI for this. Just my opinion — don’t want to start a “language war” thread.

1 Like

@Shane_Stanley - I’m going to email you also!

Thanks Shane. Sorry for the late reply. TL;DR: I switched to Xojo last month and haven’t looked back at ASObjC.

Long version:

Last month I found an old ASObjC table example dated 2009 that I had downloaded from scriptingmatters.com years ago that was written by you. I got the project building in Xcode 14 and eventually got it to fill a table with my own data but the time it took for me to understand how to work with that one control left me feeling old, stupid and unable to learn this ASObjC stuff, haha. Prior to finding your example I’d spent many hours with youtube videos and other people’s broken tutorials trying to figure it out. It’s not the rapid development environment AS Studio used to be, not if I have to learn Cocoa method calls for anything. :frowning:

The day after I finally got the table working in ASObjC, I wondered whatever happened to RealBasic. That led me down a Xojo rabbit hole spending a couple hours reading and watching intro videos. The next day I downloaded Xojo, redrew my app’s main window, found a free third party Xojo xml-rpc control and got the control’s response data loading into my app’s first table. After a week of full-steam-ahead progress in Xojo I dropped $$$ on a Xojo Pro license so I could build apps for all the supported platforms.

Today I have the rest of my app mostly rewritten in Xojo and it builds Windows and Linux versions too. I can’t believe I wasn’t aware of Xojo at all—I thought RealBasic had disappeared years ago—I missed the memo on the name change. This is what I needed all along! Everything comes together so fast and easy and just works (most of the time) that I don’t feel so old and stupid anymore, haha.

Left: AppleScript Studio version (no dark mode in ASS); middle: Xojo version; right: Xojo version for Windows 11 ARM.

Xojo can call compiled AppleScripts, pass parameters to their run handlers and get a result back (string or integer only, but json counts as string) and that’s all I need. My app’s UI is 100% Xojo now and the only parts of my original app that remain are a few “tell application …” blocks clipped out into separate compiled AppleScripts with all the AS Studio code removed.

Except for the cost, Xojo seems like the fastest solution for building AppleScript apps with a GUI. The Xojo language is a no-brainer. I’ve never used RealBasic but the syntax is exactly like all the OneClick scripts I had fun writing back in the 90s so that helped me get up to speed real quick.

Swift doesn’t look any easier for me to understand than ObjC. I started rebuilding the app in Xojo (RealBasic) last month. Super easy, I also got Windows and Linux versions out of it too and I’m thrilled with the results!

Hi Shane. I’m interested in acquiring a copy of both of those books, too. My email is my username @gmail.com… I’m not sure where to find yours :slight_smile:

I’ve sent you a message.