Library of a string

I’m going through previous macscripter’s tutorials and I seem to recall Adam Bell loading up a script in the user’s script library. I’m made use of that but I also want a text string that will be in all my user’s library.

The string is the user’s path to their Acrobat In folder, which is in different places. I want to use my handler and call script, which appear to work fine. But I also want to pull in this local string from the library so that my handler will continue to work and I want to define their path once and call that text string as a property.

Looking over Adam’s tutorials, the load script works, but is there a load string, or load text?

Or am I overlooking an obvious solution? thanx, sam

The usual way to do that would be to save a text document where you wanted it and then read it back with

set Aloc to read (path to the doc). It’s perfectly acceptable to put that doc anywhere you want it like the user’s preferences folder, for example.

More formally, you would write a proper pref file.

Similarly, assuming that your user is asked to locate the folder in question on first run, you can make the result a property:

property tLoc:missing value

then later

set tLoc to (choose folder)

Properties are remembered in Tiger until the next time the script is recompiled (after a trip to the Script Editor and a run from there).

Thank you very much for replying so quickly.

My attempt seemed to fail and I’m unsure why.

I made a text file with this as its only line:


And then this is the first line of the script which would call it:

set ThePath to read ((path to scripts folder as text) & “lib1:” & “thePathProof.txt”)

It compiles, but here’s my error:

“Can’t make “Slim:Users:sam:Library:Scripts:lib1:thePathProof.txt” into type file.”

I’ve verified the path and it’s right, so clearly I’ve not followed what you set out. The latter material about user’s selecting the folder is bonus, but not needed here I believe, sam

Hi Sam,

read has two major forms:
read file path string
read alias

in your case, just add file after read

Everybody can read the string of some script library defined as property. Directly.

For example, the users who have FileManagerLib script library of Shane Stanley, can get the string copyString of this certain library:

copyString of script "FileManagerLib"