Jump to content

Platform independent way from G code to highlight a file on disk?


Recommended Posts

Posted

I'm looking for a G VI or sequence of VIs that I can use to highlight a file in the OS environment that works on all platforms. I've got mechanisms for opening a window for the directory -- that works fine. But I can't find any way to actually highlight a specific file within the directory. Any ideas?

post-5877-0-61802700-1418835972_thumb.pn

Posted

At JKI we have a tool we use internally to do this, but I haven't looked at the code under the hood and can't confirm it works cross plat form. It does work correctly on Windows, though.

Posted

I prefer the windows shell function to the command line call myself, but Windows is easy either way.

 

Linux is simple, once you know the default file browser (Nautilus, Dolphin, ....).  This is easily found by querying xdg-mime.  Then it is a simple system exec call to launch the file browser.  

 

Mac requires Applescript.  Simply use system exec and the osascript command to tell Finder to select the file.  In LV14 you may even be able to skip system exec and use the call Applescript function.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.