Javascript to open a folder on local computer

  • 0
  • 2
  • Question
  • Updated 1 year ago
  • In Progress
I currently use formula-text buttons with Javascript to open remote URLs. This works great. But I also want to use the same technique to open a folder my local Mac (so I can save files).  In Mac, you can use a link from the finder (file:///Users/drivename/folder/folder...) format to get to files NP. But unfortunately dropping this link into the formula text field or a URL doesn't work I'd think some javascript might be needed to advance this functionality?  
If the link above is listed and you right-click on it then choose "services" and the choose "Open URL" it does work..but that's too many keystrokes...can anybody help?
Photo of Stephen

Stephen

  • 760 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 2
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
what is your javascript? have you tried window.open() ?
Photo of Stephen

Stephen

  • 760 Points 500 badge 2x thumb
"<a class='Vibrant Success' onclick=\"var a=window.open('"&ToText([Link])&"', 'newwindow','width=1200,height=900');\" >Open</a>"
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,958 Points 1k badge 2x thumb
what happens when you try this? any error messages in the console?
Photo of Stephen

Stephen

  • 760 Points 500 badge 2x thumb
I'm not super-well versed in Console, but not that I can see. If I open the debugger in Safari it says there is an error loading the resource. 

If I right-click on the URL displayed in Quickbase and use the service "Open URL" Safari does open the Finder and works fine.  
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,958 Points 1k badge 2x thumb
You could just mention in the help text of that field to "Right click>Open URL" . would you and your users be able to live with that?