SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

The popular SciTE-based AutoHotkey Script Editor
guest3456
Posts: 2556
Joined: 09 Oct 2013, 10:31

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

09 Sep 2014, 03:43

dretax wrote:Your programm successfully deleted everything from the installed folder. I had it installed to a directoy, and when i updated it, it WIPED EVERYTHING from the folder. I LOST EVERYTHING.

I can't even recover the files with recuva.....
yikes. thats horrible

User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

10 Sep 2014, 13:04

I'd like to be able to run highlighted text. (so instead of running the entire file, it will only run the text that is highlighted.) Ideally this would also be working from a file that has NOT been saved. Is there anyway to get SciTE to do this?

On this page http://www.scintilla.org/SciTEDoc.html I found this text:

On Windows, the optional command.input property specifies text that will be piped to the command. This may reference other properties; for example, command.input.0.*.cc=$(CurrentSelection) would pipe the current selection to the command processes. The command.input property is only supported for subsystem 0 (command line programs).

This seems close to what I want however I'm not sure how to get it to run in AutoHotKey.
Any help / hints would be greatly appreciated!
guest3456
Posts: 2556
Joined: 09 Oct 2013, 10:31

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

10 Sep 2014, 16:02

Joetazz wrote:I'd like to be able to run highlighted text. (so instead of running the entire file, it will only run the text that is highlighted.) Ideally this would also be working from a file that has NOT been saved. Is there anyway to get SciTE to do this?
we're on an AHK forum, why not just do it in AHK in 30 seconds?

Code: Select all

Send, ^c
FileAppend
RunWait
FileDelete

User avatar
joedf
Posts: 7194
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

11 Sep 2014, 00:24

Adding on... You can customize the toolbar for a button, that will do what you want, also you can use the COM interface for scite4ahk, see here: http://fincs.ahk4.net/scite4ahk/pages/comiface.htm
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

11 Sep 2014, 07:33

I'd like something more elegant than just sending keystrokes saving the file/then running it. One of the main reasons is I want to keep it in the active window so I can monitor out Output pane for errors, etc. (WHile my main use of SciTE is w/AutoHotKey, I also use it for Python and much of the Python output is also put there)

@joedf- I don't unerstand how I could create a button that would execute the highlighted text. Can you give me an example? On a second note- I wasn't aware of the COM interface and spent the last hour reviewing. Very very cool!

BTW- yesterday I added the below functionality to my context menu where it will take the highlighted word and submit a google search to the ahkscript.org forum. Very cool stuff!
(please realize the below is grabbed from specific sections of my SciTEUser.properties file. I didn't want to copy/paste the whole thing here but you can merge it with my previous example earlier in this post. Can someone please explain why I have to list it in my context menu seciton ast 1141 but I need the command to be .41? I can't understand why I need to add 1100 to it...

Code: Select all

#Add below line to your customized context menu
Search AHK Forum|1141|\

# 1141 Google search selected item on ahkscript.org  -this needs to be below the above code/section
command.name.41.*=Google Search AutoHotKey.org
command.41.*="https://www.google.com/search?q=site:ahkscript.org+$(CurrentSelection)"
command.subsystem.41.*=2
command.quiet.41.*=1
dretax
Posts: 2
Joined: 08 Sep 2014, 05:57

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 06:04

guest3456 wrote:
dretax wrote:Your programm successfully deleted everything from the installed folder. I had it installed to a directoy, and when i updated it, it WIPED EVERYTHING from the folder. I LOST EVERYTHING.

I can't even recover the files with recuva.....
yikes. thats horrible
Yeah. I had like 4 big scripts, and I have to rewrite them...............

I Would recommend everyone to not use the installer in the same folder......
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 08:30

I was able to figure out how to highlight text and have SciTE run my Python code.

Code: Select all

#  1143  Run python code  http://stackoverflow.com/questions/14569977/submit-current-selection-to-r-from-scite
command.name.43.$(file.patterns.py)=Run Python code
command.mode.43.$(file.patterns.py)=subsystem:0,savebefore:no
command.43.$(file.patterns.py)="B:\progs\python27\Anaconda\pythonw.exe" 
command.input.43.$(file.patterns.py)=$(CurrentSelection)
command.shortcut.43.$(file.patterns.py)=Ctrl+r
However I can't figure out how to get it to do the same with AutoHotKey. Anybody have any suggestions? The following does NOT work.

Code: Select all

command.name.45.$(file.patterns.ahk)=Run AutoHotKey
command.mode.45.$(file.patterns.ahk=subsystem:1,savebefore:no
command.45.$(file.patterns.ahk)="B:\Progs\AutoHotkey_L\AutoHotkey.exe"
command.input.45.$(file.patterns.ahk)=$(CurrentSelection)
command.shortcut.45.$(file.patterns.ahk)=Ctrl+k
On this page http://www.scintilla.org/SciTEDoc.html there is info on what "subsystem" to use. I first tried 1 (as I do have windows pop-up) and that didn't work, then I tried all the others but nothing worked.
Any help would be greatly appreciated. I think this would be an AWESOME functionality. I'm already loving it with my Python code as I can test little snippets out easily.
User avatar
fincs
Posts: 500
Joined: 30 Sep 2013, 14:17
GitHub: fincs
Location: Seville, Spain
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 15:48

dretax wrote:Your programm successfully deleted everything from the installed folder. I had it installed to a directoy, and when i updated it, it WIPED EVERYTHING from the folder. I LOST EVERYTHING.
I can't even recover the files with recuva.....
Yeah. I had like 4 big scripts, and I have to rewrite them...............
I Would recommend everyone to not use the installer in the same folder......
First of all, I'm sorry for your loss. However, you were never supposed to save your scripts in the SciTE program folder. That folder should only be modified by the SciTE4AutoHotkey installer and said installer wipes the folder by design before copying the new program files. Please save your scripts somewhere else, in a sane location.
Joetazz wrote:I'd like to be able to run highlighted text. (so instead of running the entire file, it will only run the text that is highlighted.) Ideally this would also be working from a file that has NOT been saved. Is there anyway to get SciTE to do this?
You cannot do it without an intermediary AutoHotkey script. The 'input' property of a command merely sets the data that will be written to the launched program's stdin. Some interpreters (such as that of python or other languages) are able to read the script from stdin (and is in fact the default behaviour when they are called with no arguments). AutoHotkey does not have this functionality. (lexikos: add AutoHotkey.exe /RunStdIn hint hint)
Joetazz wrote:

Code: Select all

# language 
menu.language=\
&AutoHotkey|ahk||\
&Lua|lua||\
&HTML|html||\
&INI and property files|ini||\
&Py|Python||\
&SPSS|sps||\
&Sql|sql||\
$(ext.menu.language)\
$(user.menu.language)
Don't do that. Please instead use the user.menu.language property, which was created for this purpose:

Code: Select all

user.menu.language=\
&HTML|html||\
&Py|Python||\
&SPSS|sps||\
&Sql|sql||
fincs
Windows 10 x64 Build 17134 / AutoHotkey v1.1.29.01
Get SciTE4AutoHotkey v3.0.06.01 - [My project list]
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 16:19

fincs- thank you very much for explaining the issue! I really think being able to submit highlighted text would be pretty darn awesome! I think I will develop a separate script to quickly save highlighted text then launch but I do hope, some day, we can get it integrated as you hinted.

y'all have an awesome weekend!
Joe
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 16:30

@fincsDon't do that. Please instead use the user.menu.language property, which was created for this purpose:
user.menu.language=\
&HTML|html||\
&Py|Python||\
&SPSS|sps||\
&Sql|sql||
I tried to swap out my code with your example but it no longer allows me to choose the languages from the Language menu. Should I be looking for it elsewhere?
User avatar
fincs
Posts: 500
Joined: 30 Sep 2013, 14:17
GitHub: fincs
Location: Seville, Spain
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 16:33

It worked for me (I edited SciTEUser.properties). Try restarting SciTE and see if that works.
fincs
Windows 10 x64 Build 17134 / AutoHotkey v1.1.29.01
Get SciTE4AutoHotkey v3.0.06.01 - [My project list]
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

12 Sep 2014, 16:39

That is the file I edited as well and I was restarting SciTE every time. (I know most things don't require it but it became clear this did.

I'll play with it over the weekend. I'm sure I'll figure it out.

Thanks again for all your work on this! SciTE is really an amazing tool!
Regards,
Joe
lexikos
Posts: 6504
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 03:55

fincs wrote:(lexikos: add AutoHotkey.exe /RunStdIn hint hint)
Do it yourself hint hint. :angel:
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
GitHub: cocobelgica

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 05:23

Joetazz wrote:I'd like to be able to run highlighted text. (so instead of running the entire file, it will only run the text that is highlighted.) Ideally this would also be working from a file that has NOT been saved. Is there anyway to get SciTE to do this?
Using S4AHK's COM interface and HotkeyIt's DynaRun you can create a plugin to achieve this. However, I would love for AHK to support AutoHotkey.exe /RunStdIn. :)
User avatar
joedf
Posts: 7194
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 06:18

:lol: :D
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
fincs
Posts: 500
Joined: 30 Sep 2013, 14:17
GitHub: fincs
Location: Seville, Spain
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 10:49

lexikos wrote:
fincs wrote:(lexikos: add AutoHotkey.exe /RunStdIn hint hint)
Do it yourself hint hint. :angel:
You lazy boy :angel:
https://github.com/Lexikos/AutoHotkey_L/pull/31
fincs
Windows 10 x64 Build 17134 / AutoHotkey v1.1.29.01
Get SciTE4AutoHotkey v3.0.06.01 - [My project list]
User avatar
joedf
Posts: 7194
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 10:57

silly willy :facepalm: :)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

13 Sep 2014, 12:00

Thanks for this! I'm not a programmer and have learned nearly everything I know from reading the AutoHotKey forums. Am I understanding it correctly in that I will need to take the file you created and "compile" a custom build of AutoHotKey? I think I'm ready for this step, I just want to make sure I'm on the right trail.

Regards,
Joe
User avatar
joedf
Posts: 7194
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

16 Sep 2014, 01:04

Alright, here you go, Joetazz
Just took a 5min to create "SelectRun.ahk" for ya ;)

With a toolbar icon, and respects the set platform in scite. Even Im using it right now! :D
SelectRun.7z
(1.97 KiB) Downloaded 102 times
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 2x8GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
Joe Glines
Posts: 632
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06 [Updated August 18 2014]

16 Sep 2014, 07:05

Thanks joedf and pretty cool! :D I'll want to add it to my context menu as well as have a hotkey for launching it.

I believe you meant to have use edit UserToolbar.properties not "SciTEUserToolbar.properties". Also, for those of you that have moved the location of the default directories, you might need to play with it a bit as the locations where you need to place the files provided and the above toolbar will not be in the locations mentioned.

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 6 guests