Copy link to clipboard
Copied
var path="Users/bagonterman/Desktop/";
var file="Tutorial.pdf"
var colon="%3A"
var colon=":"
app.openUrl("file"+colon+"///"+path+file);
I would like to either open up a pdf or html and I can do neither because when I send this the colon disappears.
It shows up like this file///Users/bagonterman/Desktop/Tutorial.pdf . I think that it may be because it is automatically putting http:// in front
and then it does not accept the colon after that. Any ideas as to how I could get around this?
Copy link to clipboard
Copied
For now I have no idea how to make that worked the way you tried, but temporarily you may use this method:
app.system('start chrome.exe "file:///Users/bagonterman/Desktop/Tutorial.pdf"')
However I'm on Windows with Chrome browser, but it should work on Mac if you choose other browser and 'open' command instead of 'start'. By the way, if I changed 'chrome.com' to just 'chrome' it works as well since I installed it.
Copy link to clipboard
Copied
I tried this and received a 256.Maybe I need to look at how that runs on the mac side. It might not be exe
app.system('open chrome.exe "file:///Users/bagonterman/Desktop/Tutorial.pdf"')
Copy link to clipboard
Copied
Okay this is what I ended up using for the mac side.
Thank you for your help!
app.system('open -a "Google Chrome" "file:///Users/bagonterman/Desktop/Tutorial.pdf"')
Copy link to clipboard
Copied
How did you find it, on Google or yourelf, and what is that -a parameter?
Copy link to clipboard
Copied
I looked up how to open the file with a mac terminal. I don't know what the a tag does but it works.
Copy link to clipboard
Copied
-a, --annotate
Make an unsigned, annotated tag object