How To Use Shane's Script Library Pack (App)

Shane’s Script Library Pack

This is an application that includes copies of the Myriad Tables Lib, SQLite Lib2 and BridgePlus script libraries, with the frameworks compiled in universal format (that is, for both Intel and Apple Silicon Macs). The versions are otherwise identical to the previous Intel-only versions listed below.

The libraries are being distributed within an application. To use them, mount the disk image, drag the applet to your startup disk, preferably in ~/Applications/ or ~/Library/Script Libraries/, and launch it. Once you approve it, quit it and launch it again. You can then quit it, and the libraries will be available to your scripts until you delete the application. You do not need to keep it running. The application also gives you the option to export the relevant documentation.

Shane, thanks again for sharing all of your great script libraries❗

I have read all of your documentation that goes with this app, and I am still unclear on how to actually reference each Script Library in SD7.

Although this works:

use sqlLib : script "SQLite Lib2"

set thePath to (path to desktop as text) & "Testing.db"
set myDb to open db in file thePath with can create
update db myDb sql string "create table test (a, b, c, d)"
-- do other stuff here
close db myDb

the script libraries in the app do NOT show up with other libraries:

image

and I don’t see a reference to the scripting dictionaries for these in SD7.

I did see an option to EXPORT the libraries when I choose “More” from the app:

image

So, what is the best practice for SD7?

That’s right — listing libraries stored other than in the default paths is a new feature in Script Debugger 8. But the libraries work just the same, as long as the OS knows about them.

(There’s no way Script Debugger can get a list of known script libraries from the OS, unfortunately — we have to track the content of the various folders ourselves. We’ve expanded the number of folders we track in version 8.)

Exporting only makes sense if you’re planning to embed them in applets you intend to distribute, which means you also have to codesign the resulting applets. For most people, even if distributing scripts, they’re better off just getting the intended users to install the pack app.

Two questions about this Library pack.

What is the benefit of storing the library files in an app?

Would it be OK to just put the library files in the User’s Script Library folder (and embed them in applets to distribute)?

The reason I ask is I recently have been having issues (unrelated to AppleScript) with MacOS 12.4. I did a sort of clean install (backed up the startup drive, erased it, installed MacOS, then restored files from backup).

After doing so scripts didn’t see the libraries in the app until I ran it once.

After a couple crashes, over a few days, same thing happened again. And again just now. Scripts calling SQLite Lib2 library failed until I launched the app.

I think I’d prefer to just have the libraries in the library folder (or embeded in my app’s library folder rather than inside another app).

→ Script Debugger 8.0.5 (8A57)
→ MacOS 12.4

It skirts permissions issues that are otherwise very user-unfriendly to work around.

You can do that, but see point above. It’s certainly fine to embed them for distribution.

Where are you storing the apps?

In the user’s scripts library folder.

Try it in /Applications or `~/Applications’. The system monitors them more closely.

I’m having issues with this pack. After I eject it, it re-mounts itself after a few minutes. The issue persists even after rebooting my mac. I don’t know how to make it stop.

Did you drag the contents to your hard disk before launching the app? It sounds like you have opened a file directly from the disk image – don’t do that.