Job Creation in webhookTriggered() - File Does Not Exists...
Posted: Thu May 02, 2019 12:25 am
Hi,
I'm creating a new job within the webhookTriggered() function. I've tried using the standard example from the docs:
This works but creates a file called '_XXXXX_dummyFileForNewJob.dat'
What I need to do is take a path/filename and send that to single instead. Something like:
This "sort of" works. It creates a correctly named file at path that I can send to single. But I also see this in the Messages Log...
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:
But the "File does not exists" (need to fix the grammar there too!) message persists.
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
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