Link to home
Start Free TrialLog in
Avatar of zhangjing
zhangjing

asked on

Use lotus scripts to launch applications

I want to create a lotus script, if the attachment is text file, automatically launch the "notepad.exe", if a wav, launch "recorder", if a doc, launch "word", etc. Just like the "launch" button shown in attachment tab works. Is that possible? in the program, first, detach the attachment to a specified location, this is easy to be done, second, launch programs corresponding to the file type, and open the file.
Avatar of HemanthaKumar
HemanthaKumar

Yes you can do that by using 'shell' command in lotus script.

Syntax: shell( "program name <filename>",windowstyle)

eg:  t% = Shell ("notepad.exe \Chipset.txt",1)

Good Luck
Hemanth
Avatar of zhangjing

ASKER

Yes, I know the Shell function.

But how can I know what is attached to my document? Maybe it's a text file, maybe it's a bitmap, maybe it's a Word......

I want to open different file with different applications, just like the "launch" button do in "Attachment" dialog.

I can't use @Command too, because I want to control where the file will be extract too.
Detach the file to a temp directory and pass the filename to the shell function. The file will be opened with the registered application, if file type is not registered, windows will prompt for the application.

Hemanth
This is what I copied from the Notes help. You know the Shell can't work.

Syntax
Shell ( program [ , windowStyle ] )
Elements
program
A string expression whose value is the name of the program to run, including arguments. program be the name of an executable file that uses a file name extension of BAT, COM, PIF, or EXE. You can omit the file name extension, and you can optionally include a complete path specification.
Using an internal DOS command name generates an error.
ASKER CERTIFIED SOLUTION
Avatar of brel
brel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much! It works! Although a little ugly, everytime it will first show a black DOS screen, is there anyway to "hide" it? That will be more better. :)
In NT4 the DOS screen opens and closes directly then the application is launched. The behavior on W9x I haven't tested.

Your welcome
/Brel