Include script lib in an app

Hi,

Is it possible to include a script lib in an ASOC app ? How ?

And the script library dependencies refers to that or not ? Because I use script libs in an app and the panel shows 0 ref.

Thx.

What do you mean by an “ASOC app”?

That :

That’s just a standard applet with the appropriate use framework statement already added. So you use a library in it the same way as any other applet.

Or are you asking about how to embed a library in the applet? Sorry, but I’m not sure what you are after.

Yes I’m asking about how to embed a library in the applet automatically (if possible).

Right now I have to check my code if there is a “tell script” and change it to a “load script” with the resources path.

Thx.

If you are exporting a run-only version of your applet, you can check Include used libraries in the Resources Pane, and they will be added automatically at export. If you’re not exporting, you need to add them yourself: go to the Resources Pane, control-click in the bottom Resources area and choose Add Script Libraries Folder, then drag the library from the Finder into the Script Libraries folder in the Resources list.

That’s a less than ideal approach.

1 Like

Ok so what is the good approach ?

Now I manage all my script library in the Script Libraries folder which is sandbox friendly. It is useful for my scripts I use for many tasks (Finder, iTunes, etc…) and now I’d like to distribute some of them so I have to include them in the bundle but the path changes…

Thx.

The best approach is to export run-only versions for distribution. Then you can have Script Debugger include them for you automatically. If you want to distribute editable versions, just do what I outlined above. Either way, there’s no problem with oath changes: Script Libraries are searched for in a particular order, effectively starting in the app bundle, and falling back to ~/Library.