Does EggPlant have a global library?

Can I store my functions in a global path, so I can access it from any script?
For example:
If I have a function called reverseText; can I store this function in some global place and then call it in any new script?
Thanks

Comments

  • badincan--

    The way I do it is that I store all my functions in a script file, and at the beginning of my scripts, I "add it to the backscripts" by saying:
    start using "myfunctions"
    
    Once you've added this line, simply call your function/script as if it were a standard command.

    If you're using one script to kick off many, you only need to stick this line in your kickoff script.

    Look up "Start Using" in the manual for more info.

    HTH,

    Allen
  • If you added the suite that contains that script in the Helper, you can just start using whatever the functions you have made without any additional codes. If it's in the same suite, you can just use it anywhere.
  • dmredadmreda Member
    Hi, I just discovered this thread, and have a related question:

    If I have multiple Macs on a network and all have all necessary licenses, can I have a suite on one Mac be used as a helper on all the other Macs?

    Sort of a poor mans' configuration management: I want to keep our master library of useful scripts one one Mac, and then just let all the other Macs reference that one "master" suite when they need something from that library.

    Is this possible with the OpenSuite command, where I'm opening a suite on another Mac on the network? What would the syntax be?

    Thanks!
    Dennis
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Sure, you can do this. Rather than using the OpenSuite command, I suggest you use the newer InitialSuites (or FinalSuites) global properties. These are lists of suites that will be checked for called scripts before (and after) the current suite. Most often, for a utility library you'll want to use the FinalSuites so you have the ability to override some of the library scripts locally if you need to:
    Insert "/path/to/remote/commonLibrary.suite" into the FinalSuites
    
  • dmredadmreda Member
    Sorry for being thick, but what's the syntax for accessing suites on another Mac entirely?

    If my machine has local address of xxx.yyy.zzz.aaa and I want to use a suite on another machine, say with address xxx.yyy.zzz.bbb how do I reference that other Mac?

    I was thinking to just open an FTP and download all the files to a local folder, but I was thinking it'd be slick to just reference a remote suite, something like OpenSuite ("xxx.yyy.zzz.bbb:/path/on/remote/host/MyLibrary.suite")

    -Dennis
  • EggplantMattEggplantMatt ForumAdmin admin
    Hi, Dennis,

    You're going to want to mount the drive of the other Mac on the Eggplant machine, which means it will need to be shared. Then you can refer to it by volume name and path.
  • dmredadmreda Member
    Thanks, I'll give that a whirl!

    D.
Sign In or Register to comment.