[OT] Windows Command Help

Lynch, Jonathan bnz2 at cdc.gov
Fri Jul 29 09:37:17 EDT 2005


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

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list