Hello Vince,

You could use this scripted function which has similar syntax
to file.doverb but ignores context menu extensions:

[EMAIL PROTECTED]("c:\folder\file.txt","Edit")

Caution: yahoo will probably break long lines in my script
with hard Returns.

;;------------------ misc.powerpro -----------------
@doverb

zInputFilePath = arg(1)
If(not validpath(zInputFilePath)do
  win.message(zInputFilePath ?" is not a valid file path", "Verb doing script")
  quit
endif

zVerb = arg(2)
zFileTypeKey = reg.get_value(?"HKEY_CLASSES_ROOT\." ++ 
file.type(zInputFilePath) ++ ?"\")

;; maybe another test here

zAllVerbs = reg.enum_keys(?"HKEY_CLASSES_ROOT\" ++ zFileTypeKey ++ ?"\shell\")
If(not index(zAllVerbs,zVerb))do
  win.message(?"No such verb " ++ zVerb ++ " for *." ++ 
file.type(zInputFilePath), "Verb doing script")
  quit
endif

zCommand = reg.get_value(?"HKEY_CLASSES_ROOT\" ++ zFileTypeKey ++ ?"\shell\" ++ 
zVerb ++ ?"\command\")

;; Now change zCommand to replace the registry's filepath placeholder
;; with zInputFilePath.
;; First try "%1" with quotes, then try %1 without quotes:

If(index(zCommand,?#"%1"#))do
  zCommand = replacechars(zCommand, ?#"%1"#, ?#"# ++ zInputFilePath ++ ?#"#)
elseif(index(zCommand,?#%1#))
  zCommand = replacechars(zCommand, ?#%1#, ?#"# ++ zInputFilePath ++ ?#"#)
endif

Do(zCommand)
quit

;;-----------------------------------------------------------

Where it says: ";; maybe another test here"
you could ask reg plugin to test whether this key exists:
"HKEY_CLASSES_ROOT\" ++ zFileTypeKey ++ ?"\shell\"
and quit with a message if it doesn't:
"This file type does not have a proper association."

Alan M



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to