// Open Safari with a custom URL
// Here we generate a date-based URL, but other options might include calling out
// to another command-line tool to read one from a file.
//
// Scripts like this are intended to be set as "Session Start" scripts, that run automatically
// when a session begins

let cmd = 'open -b com.apple.Safari '

let date = new Date().toISOString().slice(0, 10);
let url = 'https://www.example.com/?date=' + date;

cmd += app.shellEscapeArgument(url) + ' ';

let [status, stdout, stderr] = app.runShellCommand( cmd );
