I'm creating a new job within the webhookTriggered() function. I've tried using the standard example from the docs:
Code: Select all
//create new job
var job = s.createNewJob();
var f = new File(job.getPath());
f.open(File.WriteOnly);
f.writeLine("Sample line.");
f.close();
//single outgoing connection only
job.sendToSingle(job.getPath());
What I need to do is take a path/filename and send that to single instead. Something like:
Code: Select all
//create new job
var job = s.createNewJob();
var logPath = job.createPathWithName("logFile.txt");
var f = new File( logPath );
f.open(File.WriteOnly);
f.writeLine("Sample line.");
f.close();
//single outgoing connection only
job.sendToSingle( logPath );
File does not exists: /Users/work/Library/Application Support/Enfocus/SwitchScripter/temp/EnvironmentClass/85/_0077G_dummyFileForNewJob.dat
So I try adding this at the bottom of the code:
Code: Select all
job.sendToNull( job.getPath() );
My Question:
Within a function that has no "job" to use (timerFired(), webhookTriggered()), how do I create a file at a path and send it to single without getting a "File does not exists" message?
Thanks for any insights into this.
-Pat