Sign in to follow this  
Followers 0
will88

Right click -> Edit with autoit script

6 posts in this topic

is it possible to be able to right click on a .html file and have it set so you can edit it with an autoit script?

Example:

Posted Image

under "Edit with notepad++" or in replace of have an option to edit with an autoit script that I made to write in?

Thanks

Share this post


Link to post
Share on other sites



In short, yes. Search for file associations.

Share this post


Link to post
Share on other sites

In short, yes. Search for file associations.

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?

Share this post


Link to post
Share on other sites

That is passed by command line.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0