Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: referencing stuff in other files




On 25 Feb 2006, at 16:05, Mr Tea wrote:

This from Jeremy Matthews - dated 25/2/06 13.59:

Is there a way you can reference an item/list string, or other errata
in another file (perhaps, an applescript file?).

What you probably want here is the 'file read/write' commands from the 'standard additions' osax provided with AppleScript.

A simple script for reading the contents of a text file might look like
this:


  set f to "Diskname:Foldername:Filename"
  open for access file f
  set filecontents to read file f
  close access file f

Or simpler still:

----------
read file "Diskname:Foldername:Filename"
----------

If the item required is a script property, then something like this should do the trick:

----------
myProperty of (load script file "Diskname:Foldername:Scriptname")
----------

(Where 'myProperty' is the label of the property required.)

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: referencing stuff in other files (From: Mr Tea <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.