PDA

View Full Version : Opening a file or WebSite From Max Script


mrapelje
12-23-2004, 07:53 AM
Is there a way to have MaxScript open/launch a file. i.e. like double clicking on a file on you desktop.

I would like to open/launch a Text Doc this way.

Opening a web site like clicking on a link would also do the trick.

I have been playing around with the

getOpenFileName

But this seems to only be a way of bring in information into a max file.

Thanks for any help.

lechoo
12-23-2004, 08:52 AM
Check "Executing External Commands and Programs" in max script reference.

greets

Bobo
12-23-2004, 10:37 AM
Is there a way to have MaxScript open/launch a file. i.e. like double clicking on a file on you desktop.

I would like to open/launch a Text Doc this way.

Opening a web site like clicking on a link would also do the trick.



Shelllaunch does the trick - it simulates the double-clicking on a file.
It expects two parameters - if you submit the file name and an empty string, like

shellLaunch "myfile.txt" ""

then the default Windows application will be launched to open the file.

If you supply an application and a file name, it is like dragging the second file over the first, for example

shellLaunch "notepad.exe" "myfile.txt"

will launch Notepad to open the file. Obvioulsy, if the path of the application is not in the Windows paths, you might have to supply an absolute path to the application...

Cheers,
Bobo

mrapelje
12-28-2004, 04:49 AM
Guys:

Thank you for the help. Shelllaunch did the trick. Sorry for the long reply.

CGTalk Moderation
01-20-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.