How can I run a Ruby script from the SciTE Tools menu that can process a text file currently open in SciTE?

278 views
Skip to first unread message

het...@gmail.com

unread,
Aug 1, 2013, 8:41:24 AM8/1/13
to scite-i...@googlegroups.com
Hello,
 
I am using SciTE Ver. 1.59 [I cannot change that version], and recently learned how to setup my own commands to run from the
Tools menu [thanks to this group]. I now have another question:
 
A: I open a Ruby source code file in SciTE so I can work on it.
B: I start a Ruby file [a TK application] from the Tools menu which I use to process Ruby source code files.
 
Question: How can I 'tell' the Ruby file [B:] when it is started from the Tools menu to automatically read the file currently open in the SciTE editor [A:]?
 
Thanks for your help,
 
Harry

Philippe Lhoste

unread,
Aug 2, 2013, 5:46:49 AM8/2/13
to scite-i...@googlegroups.com
Look at my previous answer, where I shown how to start a command. There is a line like:
command.input.40.*=$(CurrentSelection)

SciTE has various useful built-in variables like this CurrentSelection, including some
giving the path to the current file.

See http://www.scintilla.org/SciTEDoc.html

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Harry Truax

unread,
Aug 5, 2013, 9:34:27 PM8/5/13
to scite-i...@googlegroups.com
Thanks for the answer Philippe, I got it working. Is there a way to get a list of all open files? I tried SessionPath but could not get it to work.
Thanks,
 
Harry
 


--
You received this message because you are subscribed to a topic in the Google Groups "scite-interest" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scite-interest/VcS4Xpmm5Ow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scite-interest+unsubscribe@googlegroups.com.
To post to this group, send email to scite-interest@googlegroups.com.
Visit this group at http://groups.google.com/group/scite-interest.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages