• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using a library to point to source folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using a library to point to source folders


  • Subject: Using a library to point to source folders
  • From: Jim Brandt <email@hidden>
  • Date: Tue, 4 Jan 2011 09:21:13 -0600

Is there a way to code a string in one script, store it in a library file, and use that definition in a second script in a way that the string can be  different on separate machines but all scripts loading it can work the same?

Let me explain.

One my desktop machine, I store all my source code for scripts in a folder on a partition of my hard drive that is not the startup volume. I have hard-coded the various folders containing scripts and libraries in all my sources.

However, I wish to move these same scripts to a different machine (a laptop) that doesn't have the same disk structure. I wish to code one script, library (or whatever), that can be loaded from a know location (i.e. the script folder in the user's domain) that would contain the hard-coded location of all other scripts and libraries for the machine its running on.

This would allow me to only have to maintain a single script file that points to all other paths for that specific machine.

Here is what I've tried:

In the Script folder of my home directory is this script, stored under the name DefineSource.scpt:

on GetSourceDef()
return "HD2:Script Source:"
end GetSourceDef

This one file would change for each machine, and establishes the location of all my source folders for that machine.

A second script looks like this:

set myScripts to ((path to scripts folder) in user domain) as text
set DefSrc to myScripts & "DefineSource.scpt"
load script alias DefSrc

set z to DefSrc's GetSourceDef()
display dialog z

What I get when I run this script is the error message:

"OSX:Users:jimbrandt:Library:Scripts:DefineSource.scpt" doesn't understand the GetSourceDef message.

What am I doing wrong?

TIA,
Jim Brandt
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using a library to point to source folders
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: How to do a goto with Applescript?
  • Next by Date: Re: How to do a goto with Applescript?
  • Previous by thread: Re: itunes plugins to get device plugin notification
  • Next by thread: Re: Using a library to point to source folders
  • Index(es):
    • Date
    • Thread