Jump to content

Right click -> Edit with autoit script


Recommended Posts

thanks, i am able to right click on an .html file -> Edit and it will open the autoit script however still have the problem of detecting what file was right clicked on - any ideas?

If as well as associating HTML with SciTE you add a new context menu item you could run a little exe which will get the file name as a parameter. The exe can do whatever with the filename and Shellexecute($CmdLine[1]) to edit it with SciTE.

This script would add a new context menu item called "Edit with SciTE" but actually would run myprog.exe passing it the filename as a parameter.

$KeyName = "AddForHtml"
$ContextMenuName = "Edit with SciTE"
$ProgramToRun = @SystemDir & "\myprog.exe";or whatever
RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $KeyName & "\command", '', 'REG_SZ', '"' & $ProgramToRun & '" "%1"')
RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $KeyName, '', 'REG_SZ', $ContextMenuName)
MsgBox(0, "Done", $ProgramToRun & " option has been added to the file context menu")

and the myprog.exe would be compiled from a script like this

if $CmdLine[0] > 0 then
;maybe check that extension is HTML
;Do something with $CmdLine[1]
 ShellExecute($CmdLine[1])
endif
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If as well as associating HTML with SciTE you add a new context menu item you could run a little exe which will get the file name as a parameter. The exe can do whatever with the filename and Shellexecute($CmdLine[1]) to edit it with SciTE.

This script would add a new context menu item called "Edit with SciTE" but actually would run myprog.exe passing it the filename as a parameter.

$KeyName = "AddForHtml"
$ContextMenuName = "Edit with SciTE"
$ProgramToRun = @SystemDir & "\myprog.exe";or whatever
RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $KeyName & "\command", '', 'REG_SZ', '"' & $ProgramToRun & '" "%1"')
RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $KeyName, '', 'REG_SZ', $ContextMenuName)
MsgBox(0, "Done", $ProgramToRun & " option has been added to the file context menu")

and the myprog.exe would be compiled from a script like this

if $CmdLine[0] > 0 then
;maybe check that extension is HTML
;Do something with $CmdLine[1]
 ShellExecute($CmdLine[1])
endif

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...