Page 11 of 41

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

Posted: 09 Sep 2014, 03:43
by guest3456
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

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

Posted: 10 Sep 2014, 13:04
by Joe Glines
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!

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

Posted: 10 Sep 2014, 16:02
by guest3456
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

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

Posted: 11 Sep 2014, 00:24
by joedf
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

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

Posted: 11 Sep 2014, 07:33
by Joe Glines
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

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

Posted: 12 Sep 2014, 06:04
by dretax
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......

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

Posted: 12 Sep 2014, 08:30
by Joe Glines
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.

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

Posted: 12 Sep 2014, 15:48
by fincs
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||

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

Posted: 12 Sep 2014, 16:19
by Joe Glines
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

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

Posted: 12 Sep 2014, 16:30
by Joe Glines
@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?

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

Posted: 12 Sep 2014, 16:33
by fincs
It worked for me (I edited SciTEUser.properties). Try restarting SciTE and see if that works.

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

Posted: 12 Sep 2014, 16:39
by Joe Glines
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

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

Posted: 13 Sep 2014, 03:55
by lexikos
fincs wrote:(lexikos: add AutoHotkey.exe /RunStdIn hint hint)
Do it yourself hint hint. :angel:

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

Posted: 13 Sep 2014, 05:23
by Coco
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. :)

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

Posted: 13 Sep 2014, 06:18
by joedf
:lol: :D

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

Posted: 13 Sep 2014, 10:49
by fincs
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

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

Posted: 13 Sep 2014, 10:57
by joedf
silly willy :facepalm: :)

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

Posted: 13 Sep 2014, 12:00
by Joe Glines
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

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

Posted: 16 Sep 2014, 01:04
by joedf
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 121 times

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

Posted: 16 Sep 2014, 07:05
by Joe Glines
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.