• 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: Applescripts often going wrong when saved as package
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescripts often going wrong when saved as package


  • Subject: Re: Applescripts often going wrong when saved as package
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 22 Jun 2012 12:38:08 -0500

On Jun 22, 2012, at 12:23 PM, James Gretton wrote:

Hi, I have a set of AppleScripts which use some shared AppleScript libraries (written by be).

To make my library functions accessible I load the .scpt into a property. A simple example of this is below.

==========================
property includes : null
on run {}
  set includes to load script file "::Library:Applescript:general:includes.scpt"
  init() of includes
 ...
end run
==========================

I've found this works very well when testing from AppleScript Editor, but when I save my AppleScripts as applications things have been a little unreliable.

I don't know if the following may be causing a problem in your script, but it's something that you should keep in mind when one script 'run's another script file.

If your main application script (the one you compile as an application bundle) calls a .scpt file, like this ...

(path to resource (scriptName & ".scpt") in directory "MenuItemScripts") as alias
run (load script the result)

then all the handlers in the main (calling) script are available to the called script ...
HOWEVER, the properties in the main script are NOT available to the called script.

There is a work-around for this: You must, in any handler that uses a property in the mail script, declare the property name to be global.


 _______________________________________________
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

References: 
 >Applescripts often going wrong when saved as package (From: James Gretton <email@hidden>)

  • Prev by Date: Applescripts often going wrong when saved as package
  • Next by Date: color name for a label index
  • Previous by thread: Applescripts often going wrong when saved as package
  • Next by thread: Re: Applescripts often going wrong when saved as package
  • Index(es):
    • Date
    • Thread