scrapeableFile.extractData being invoke by script within script

when I call a script which calls another script, the scrapeableFile.extractData which resides on the second script doesn't work. Is this not possible?

Another Question

Thanks for the help.

I got another related question.
If I invoke the scrapeableFile.extractData() method from a script. If the extractor pattern matches. Why can't I run a script after each pattern match? I know I can save the DataSet of the extractor pattern then loop over it in the script, is that the only way to do it?

That's the only way

That's the only way. Scripts aren't automatically run with manual extraction.

Script within script

When you invoke a script from within a script, the only variable that remains in scope is session. You can't access the variable scrapeableFile in the same way that you can when the script is called from the scrapeable file.

That being said, you can still accomplish what you're trying to do by storing scrapeableFile in a session variable. It might look something like this:

In script 1:

session.setVariable("SCRAPEABLE_FILE", scrapeableFile);

session.executeScript("script 2");

Then, in the script 2:

scrapableFile = session.getVariable("SCRAPEABLE_FILE");

DataSet ds = scrapeableFile.extractData(text, extractorPatternName);