Using .save() method with a filepath with includes ~/Desktop instead of "Users/computerName/Desktop


#1

I’m creating an OmniOutliner script with JXA to create a different outline of my daily todo list depending on the day of the week.
My only hangup is that it seems I have to define my file path to where I’d like to file saved to like so:
var path = new Path("/Users/mycomputer/Desktop/myOmniOutlinefile").toString()

and then using OmniOutliner’s save method, I’d use
newOmniOutlinerDocument.save({in: path})

when I’d really like it to be like this:
var path = new Path("~/Desktop") … that way I could run the file on any of my computers. However, it doesn’t seem like JXA allows for paths to be defined that way. Unless someone knows another way?
Thanks!