• 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
Stumped - How to call subscript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stumped - How to call subscript?


  • Subject: Stumped - How to call subscript?
  • From: email@hidden
  • Date: Wed, 17 Jul 2002 03:53:36 EDT

I am still struggling with controlling scripts with scripts.

I've got a script which has a number of stored properties, and I'd like
to be able to run another script which would, essentially, "erase" the
first scripts "memory" of stored properties. Therefore, the next time the
first script did its thing (it's a Folder Action Script), its properties
(the ones which are file-pointers) would be "" and thus the user would be
prompted to choose them again.

I've a "script" in my first script that calls a handler that's defined in
the script:
-----
script clearProps
my check_init(0)
end script
-----

But, when I run this from Script Editor, it errs, with:
--> The variable clearProps is not defined.

---- begin script
set x to alias "Macintosh HD:PathToMyScriptHere"
run script x given script:clearProps
------- end script

How can I do this?

I get errors with these lines too:
-----
tell x to run script clearProps
-----
set y to load script x
tell y to clearProps


. . . I've found I _can_ get this to work:
-----------
set y to load script x
tell y to clearProps() -- I turned my "script" into a handler
store script y in x with replacing
-----------

So, is this the _best_ way to do this? I keep hoping to find a method
other than using "load script" . . . but maybe there's
-----

TIA,

Dan Feather
_______________________________________________
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.

  • Follow-Ups:
    • Re: Stumped - How to call subscript?
      • From: Timothy Bates <email@hidden>
  • Prev by Date: Newt On distribution started
  • Next by Date: Re: Stumped - How to call subscript?
  • Previous by thread: Re: Properties of junked script objects persist if referenced
  • Next by thread: Re: Stumped - How to call subscript?
  • Index(es):
    • Date
    • Thread