... is an easy way to open the folder containing a file in the Finder/Explorer/Linux Desktop.
However, am I missing something obvious? Is there a way to highlight a particular file that is simple and cross platform? (I saw one solution that involved AppleScript, obviously this will only work on the Mac.)
tetsuo29 wrote:... is an easy way to open the folder containing a file in the Finder/Explorer/Linux Desktop.
From looking at the LiveCode documentation, I believe that the "launch document" command launches the document in the default application, not the Finder/Explorer/Linux Desktop. Is this what you are looking for?
Thanks for responding. You're correct if the path given to launch document is the path to a file it will open the document with the default application. However, if the path given is the path to a folder, then the Finder/Explorer/Linux Desktop will open a window to that folder. That's what I meant by "launch document PathToAFolder."
However, it just opens that folder and does not highlight any particular file within that folder. It would be nice to be able to do what "Show in Finder" does in Safari or "Open containing folder" does in Firefox. They not only open the folder containing a particular file they also highlight that file so that if there are many files in the folder, the user does not have to go hunting for it themselves.
It'd be awesome to have a command like "highlight file PathToAFile" or "navigateToFile PathToAFile" that would not only open the containing folder but highlight the targeted file for the user and to do it on Mac, Windows, & Linux.
I googled for this and found some old runrev listserv discussions about using AppleScript to make it happen on the Mac. I have not seen any methods for making it happen on Windows or Linux.
Yes, it's very important to use the Finder/Explorer/[Whatever the equivalent is in Linux]. I don't want to develop my own file browser I want to allow the user to press a button in the interface and be take to the file in whatever native desktop they are using.
The good news is, that I found an AppleScript to do it on the Mac and I was able to develop a VBSCript to do it in Windows. I've 2 out of 3 desired OSes working. So, now the challenge is- can it be done in Linux?
xdg-open "path to file" will open the file in the default application.
xdg-open "path to folder" will open the containing folder in the default file manager with no selection
On my server at least (Mepis) dolphin has a --select argument so:
dolphin --select "path to file" will open the containing folder in dolphin with the file selected. Maybe other file managers will have a similar option?