Browse Folder

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Browse Folder

Post by warrenk » Tue Oct 07, 2008 3:11 pm

I have a application that creates a folder. Once the folder is created, I want to automatically open the folder (same way as if you double click a folder in windows) for the user to view. What would be the easiest way to do this?

Thanks!
Warren

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Tue Oct 07, 2008 3:18 pm

Hi Warren,

sounds too funny, but:

Code: Select all

...
  launch document "your/path/to/folder"
...
will do the trick :-)

warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Post by warrenk » Tue Oct 07, 2008 3:45 pm

Klaus,

Thanks...that worked great! :D

Warren

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Oct 07, 2008 3:45 pm

You can do lots of things with the command prompt too

Code: Select all

   replace "/" with "\" in tFolderPath
   -- Windows will need its native path delimiters

   set the hideConsoleWindows to true
   -- will prevent a black command prompt window being visible

   get shell ("explorer.exe /n," && tFolderPath)
   -- will achieve the same result
You can experiment with /n which will give a "normal" My Computer style window, or /e which will give a "File list" Windows Explorer style window.

The "launch" way is easier and simpler to achieve your result, but you can see how the "get shell" structure can be used to have more control of the command prompt options.
You can also make a vbscript function and "do" && scriptTerm as "vbscript" which may be useful for you to look up.

Post Reply