0

Button to local folder

Is it possible to use a button that will take you to a folder located on your computer

11 replies

null
    • Mconneen
    • 4 yrs ago
    • Reported - view

    @bureaua.... Interesting use case..   I tried the "openURL" function with variations of

    openURL("file:///dir1/dir2/dir3");

    openURL("file://localhost/foo/bar");

    openURL("file://127.0.0.1/foo/bar");

    But Ninox was smarter than I.. and knew that while chrome (and most modern browsers) understand "file:" as a protocol and will open a directory listing within the browser..  Ninox must be looking explicitly for the http or https protocol... because if I enter something like 

    openURL("http://fubar")... it launches the default browser.. 

    I call this a BUG.. openURL should simply do that.. launch the default browser and open the URL.   :)   

    SOOO.. I started playing around with the URI .. and smb:// DOES seem to want to launch a file connection.. but I ran out of my timebox to completely figure it out..   BEWARE .. smb:// may open up connection to a larger network than you want...

    fileshare

    I guess as a work around.. Create a Drobox / Box / (you pick a file share service) .. and use the https://   to get to it.. :) 

    • CISOFT_Sarl
    • 4 yrs ago
    • Reported - view

    I have realised i same solution with a local webserver (mamp). When you click on a buton url i go to : http://localhost/myPreviewNinox.php?monfichier=0010_171223085548_001.pdf&affichage=finder

     

    And then, in php file a switch if a want see in finder mac or directly in browser (affichage = finder).

     

    Now in php file : 

       if ($_GET['affichage']=="finder")
            {

                $myVar = $_GET['monfichier'];

    echo shell_exec("sh myscript.sh {$myVar}");

            }

     

    and in mac in your server folder you put the bash script sample : myscript.sh. (in my case for a network folder)

    #!/bin/bash

    open -R "/Volumes/YOUR_FOLDER/$1"

     

    Now when you ran your local server web and click on url button, you can directly open your file in finder mac.

     

    et voila.

    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Robert... Good work around..  Thanks!

    • Andre_P
    • 3 yrs ago
    • Reported - view

    Hello dear Ninox-Team,

    any news or intend to change that?

    openURL(“file:///dir1/dir2/dir3”) would be very helpful!

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Maybe this tread helps ? 
    https://ninox.com/en/forum/ideas-and-suggestions-5abb9f4f45eda7ea1e75ed02/request-for-field-or-command-to-open-an-ios-app-5f7dc004c668ec61faabecfc?post=5f7e2aad9b9a930f44213f54&page=1

    Steven

    • Andre_P
    • 3 yrs ago
    • Reported - view

    Hello Steven,

    sorry but this thread does not help. Ninox opens perfectly “http” links but refuses to open for some reason “file:///” links.

    • CISOFT_Sarl
    • 3 yrs ago
    • Reported - view

    Hi, 

    I“have made my button like :

    1. create a appliscript to open a folder, for me my scan inbox folder(in my case my folder is on shared nas):

    set targetFolder to POSIX file ”/Volumes/SCAN_INBOX“

    tell application ”Finder“

    open targetFolder

    activate

    end tell

    2.save the applescript as a application and put it in the folder like bellow(Library).

    3.create a button in ninox and put the code for openUrl

    openURL(”file:///Library/myNinoxScript/openMyFolder.app“)

     

    A other way is you run a local server web on your mac and create a script with php to execute a script to open the folder.

     

    Have a nice day.

    Robert

    • Mconneen
    • 3 yrs ago
    • Reported - view

    @Robert... I had thought about appleScript / automator ... but do not know much about it... Using your example, I get the following error message:

    The application “Ninox Database” does not have permission to open “(null).”

    I am guessing it is a permission issue.     In your above example, you used /Library ... I am using /Users/<me>/bin/ninoxOpenWIP.app ...

    • CISOFT_Sarl
    • 3 yrs ago
    • Reported - view

    Hi Mconneen, 

    i have tested many folder, but the only one who work for me is Library. 

    You can open applescript on your mac and record your action and then he make code for you. When you have finished your script, sav as app and then follow my tuto above. I hope this message help you. 

    • Andre_P
    • 3 yrs ago
    • Reported - view

    Hi Robert,

    does this only work with the mac version or does this also work with the web version of ninox?

    • CISOFT_Sarl
    • 3 yrs ago
    • Reported - view

    Hi André, yes only with mac app. For web version it is not possible, but tis right for all web action.

Content aside

  • 3 yrs agoLast active
  • 11Replies
  • 3501Views