[OT] Windows Command Help

xbury.cs at clearstream.com xbury.cs at clearstream.com
Fri Jul 29 10:08:36 EDT 2005


Jon

Nice and extensive! ;)

Here's the simple form i use in my file browser

    if the platform is "Win32" then
      put queryRegistry("HKEY_CLASSES_ROOT\."&ftype&"\") into thisappClass
      put 
queryRegistry("HKEY_CLASSES_ROOT\"&thisappClass&"\shell\open\command\") 
into thisapp
      delete word 2 of thisapp -- %1
      if thisapp is not empty then
        launch (quote & fld "path" && thisfile & quote) with thisapp
        get the result
      end if

cheers
---------------------=---------------------
Xavier Bury
Clearstream Services
TNS NT LAN Server
ext 36465
Voice: +352 4656 43 6465
Fax: +352 4656 493 6465

use-revolution-bounces at lists.runrev.com wrote on 29/07/2005 15:37:17:

> There are a number of nuances to this issue, depending on which windows
> system you are using, etc...
> 
> I pieced together the following script from scripts that others created
> for this purpose. (Just so no one thinks I am stealing someone else's
> thunder.) It seems to work pretty well...
> 
> on launchdocument pWhich
>   if there is not a file pWhich then exit launchdocument
>   revSetWindowsShellCommand
>   put revRunningWindowsNT() into tNT
>   if the platform is "Win32" then
>     replace "/" with "\" in pWhich
>     --put "file:///" before pWhich
>     set the itemdelimiter to "."
>     put the last item of pWhich into tExtension
>     put "HKEY_CLASSES_ROOT\." & tExtension & "\" into tQuery
>     put queryRegistry(tQuery) into tApp
> 
>     PUT "HKEY_CLASSES_ROOT\" & tApp & "\shell\open\command\" into tQuery
>     put queryRegistry(tQuery) into tAppCommand
>     put word 1 of tAppCommand into tAppCommand
>     replace quote with empty in tAppCommand
>     if not tNT then
>       get shell("start " & quote & tAppCommand & quote && quote & pWhich
> & quote)
>     else
>       set the hideconsolewindows to false
>       open process (tAppCommand && quote & pWhich & quote) for neither
>     end if
>     put the result into tResult
>     --answer tResult
>     if tResult = "not opened" then
>       if tAppCommand = empty then
>         answer "I'm sorry, but your computer does not have an
> application associated with that file extension. Shall I attempt to open
> it with your browswer?" with "yes" and "no"
>         if it is "yes" then 
>           revgourl pWhich
>         end if
>       else
>         get shell("start " & quote & tAppCommand & quote && quote &
> pWhich & quote)
>         if the result <> empty then
>           answer "I'm afraid I was unable to open the document with the
> associated application. Shall I attempt to open it with your browser
> instead?" with "yes" and "no"
>           if it is "yes" then 
>             revgourl pWhich
>           end if
>         end if
>       end if
>     end if
>     --  else if the platform is "MacOS" then
>     --    if "appleScript" is not in the alternateLanguages then
>     --      return "Error: AppleScript not installed"
>     --    end if
>     --    do ("open location" && quote & pWhich & quote) as appleScript
>     --  else
>     --    if gREVWebBrowser is empty
>     --    then launch "mozilla" && quote & pWhich & quote
>     --    else launch gREVWebBrowser && quote & pWhich & quote
>   end if
> end launchdocument
> 
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Brian K.
> Maher
> Sent: Friday, July 29, 2005 8:59 AM
> To: How to use Revolution
> Subject: Re: [OT] Windows Command Help
> 
> Hi Jon,
> 
> In Rev just use the shell.  The command would be "start
> you_file_name_goes_here".
> 
> Brian
> 



-----------------------------------------
Visit us at http://www.clearstream.com
                                                          
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the use-livecode mailing list