• 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
Re: Include file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include file


  • Subject: Re: Include file
  • From: julifos <email@hidden>
  • Date: Wed, 23 Jul 2003 13:25:05 +0200

> Hi,
>
>
> is there a way to include a file with global settings in an
> applescript file ?
>
> Like include file"Volumes:HD_02:Script:Glob_Settings_for_Project"
>
> I think in other languages this is a common think.
>
> Thanks for any hints.
>
> Goetz

Hi, Goetz.

The most similar function is "load script".
Eg. You have this script, whose functions/properties/whatever you wish share
with several projects:

############ common.scpt
property whatever: "whatever"

to doSomethingCommon(x)
return x^2
end doSomethingCommon
###################

But "load script" does NOT include such code in your current project. It is
a *library*, and it must be present in your system (or in your users' one),
so you can load it and use its methods:

########## some script.app
property library : load script alias "path:to:common.scpt"

library's whatever --> "whatever"
library's doSomeThingCommon(5) --> 25
###################

jj
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Rép : Apple mail: Save attached file
  • Next by Date: Rép : Sandi's Additions for OS X??
  • Previous by thread: Include file
  • Next by thread: Rép : Apple mail: Save attached file
  • Index(es):
    • Date
    • Thread