loading a subroutine properly
loading a subroutine properly
- Subject: loading a subroutine properly
- From: Bill Planey <email@hidden>
- Date: Thu, 1 Feb 2001 17:14:24 -0600
Simply because I wanted to modularize part of one of my scripts, I copied
and pasted a certain chunk of code into another compiled script. The
mother
script makes calls to handlers and the daughter script makes calls to some
of the same handlers (in other words, some of my handlers are called by
both
routine and sub-routine). I copied the variables from the mother script
(those
which identify the location of the handlers - the "set" statements which
spell
their location out). I am sure there is some way to avoid this
redundancy, but
that is not my main concern (unless it might be the cause of my main
problem).
My subroutine is basically:
on run
set handlers -- create variable and declare locations
tell application "Microsoft Word"
do stuff -- using handlers
end tell
end run
...and this subroutine is called in the mother script this way:
load script SubroutineFile -- where the location of SubroutineFile
-- has already been set earlier
this step occurs between chunks of code that call the exact same handler
used in the subroutine.
The actions that the subroutine is supposed to perform do not happen.
They are simply skipped.
What am I doing wrong?
Thanks,
Bill Planey
3311 Oak Lawn Ave., Suite 300
Dallas, TX 75219
214-528-5990 ext. 241 (office)