Batch file to set the position of the curser on windows 7 OS. How? - windows

is it possible to make a batch file that sets the position of the mouse/curser to an (x,y) coordinate on the screen? and if so, then is it possible to click on something that is in that position? Any ideas would be helpful! Thanks!

No. You would have to have a seperate executable to do this for you.
It may be possible in VBScript.
P.S. If you're interesting in automating tasks I'd download something like a mouse recorder for something simple like that. If you're automating more complicated tasks, give a shot at Autoit.

No and Yes.
You can't place the cursor at Position X,Y with pure batch, but you can replace the cursor to the home position in one line, and then you can rewrite the content.
For detecting mouse clicks with batch you need an external tool.
Try a look at Lingubender Tan's Batch tools
EDIT: You can place the cursor with pure batch to the home postion, but I need the help of the user, till now.

Related

Multiple Cursors in Autohotkey

Is there any way in Autohotkey to mimic multiple cursors like in sublime. I need a hotkey that sends and couple of text lines and leaves me with multiple cursors so I don't have to type the same text over and over. Like in the gif below.
Thanks xD.
I need a hotkey that sends and couple of text lines and leaves me with multiple cursors so I don't have to type the same text over and over.
Just to open Sublime Text and type the text you need to.
and leaves me with multiple cursors
You cannot just put several cursors/carets on any application. The application must to provide support for multiple cursors creation. AutoHotKey is not a magic application which becomes everything possible, it is an automation application to automate boring or repeated tasks. Nevertheless, maybe you can search if there are some application, which can hijack other applications to compel them to use multiple cursors/carets.
However, if you are interested in make the AutoHotKey application to create several cursors on Sublime Text, you can write an AHK script to automate the cursors creation on Sublime Text using the Sublime Text keyboard shortcuts. The default Sublime Text API for Multiple cursors/carets is not very rich by keyboard, but there are Packages/Plugins as Power Cursors and Column-Select you can install on Sublime Text to improve it.
Personally I think you are better off writing a Sublime Text Package/Plugin with the Sublime Text API to create the multiple cursors/carets you want to, instead of externally to perform it with an AHK script by keyboard shortcuts.
Ultimately you can write a AHK script which asks a text and type it for you on several lines. For example:
If you enter Type This,5
The script could type on the current window caret/cursor position
To go back with the caret 9 positions.
To go one line down by pressing the down key.
To type again the same text.
Repeate this process until 5 times.
However with this we may easily see down sides as when there are empty lines as on your screen animation. So you would be better off just using Sublime Text, which is in my Opinion the best software that exists from the all as Notepad++, Atom, etc. Sadly it is closed source, so you cannot improve it by yourself or know why it is crashing certain times, which makes me wonder to write a new one open source, compatible with the current plugins and settings for it.
As others have mentioned, you cannot use true multiple cursors unless the program your're using supports it - however, you could attempt to emulate multiple cursors in the following way:
Build a defined list of cursor positions relative to the user's cursor (e.g. 2 lines down, 3 chars across, etc.). Must be relative! How you build this list is up to you.
Wait for the user to press a key
Once input is complete, move the physical cursor to the relative positions in sequence and repeat the keypress from step 2. This should be fast so the user doesn't notice the cursor jumping around.
Move the cursor back to where the user had it and go to step 2.
This is essentially how Sublime Text implements multiple cursors, but it has much better support (and speed) because it is software-level. This solution is input-level and will probably be unable to display where the multicursors actually are, will be slow, etc. Also, because it requires a fair bit of positional calculation, the implementation may complex and prone to bugs.
Sorry - this is the best I've got, it's definitely a hack - probably better (simpler) to just automate a copy and paste :P

Type a pre defined text when a shortcut key is pressed in Windows 7

I work on mainframes and don't have much knowledge about windows other than playing warcraft :-) hence pardon me if I ask something nooby/silly.
I have a requirement to enter a particular long-text in the current position of a cursor whenever a shortcut key is pressed.
I am thinking of creating a bat file and assigning a windows keyboard shortcut to the bat file and whenever I have requirement to enter the long text, I press the windows shortcut key
and the long text gets typed in the current position of the cursor.
The current position of the cursor can be in any application, like Excel, Word or notepad or Windows dialog prompts.
Could you please let me know if this is possible and point me where I could get some information about this "technique".
Thanks & Regards,
Vasanth.S
To make a single key combo do what you are asking, you may need another program. You can make a link to a batch file, hook up a shortcut and then use the clip command to copy text from a file onto the clipboard. That would require the shortcut and then a Ctrl+V to paste. The batch file would look like this:
clip < c:\SomeDir\sometext.txt
You might like to look at using a clipboard manager - which saves a history of clipboard entries, can search for an entry, and paste it at the cursor.
Ditto and CLCL are both useful and free - which one you use depends on your windows version.
They are hotkey driven for ease of use, but mouse can be used.

How to select non-url text with Vimperator?

I'm using vimperator 3.5 with firefox 17. Everything goes well except non-url text selecting. It seems that nothing about this described in the official help document. Everytime when I want to select some non-url texts I have to use my mouse to finish it. It's really annoying.
Jumping to the point to start your select
You can use / to find whatever you want to search and use n to go to specific locations.
Selecting
Once you are there, type c to enter CARET mode where you can use hjkl to move around and use v to select just like vim.
Coping
Also use y to yank. Happy vimp!
If you select wanted text with mouse, use
Y
to copy selected text.
Good cheatsheet:http://sheet.shiar.nl/vimperator
The answer by xxinerKYU is great but according to the reference page at liberator://help/various#various is seems that i is the key to caret mode.

Does Ruby have command to format the screen like QBASIC?

QBASIC have some commands, such as LOCATE (x, y) that place the cursor at certain location on the screen, and CLS that clears the screen, which help a console application look clean.
Does ruby have the same functionality? It could be nice to use it for a small project.
Thanks for helping
No, but look up ncurses.
http://ncurses-ruby.berlios.de/
You can clear the screen with system "clear", and print the whole screen each time.

Mac-Automator, How to pipe the output of a shell script to a GUI text box

The problem I face is this:
I would like to have in a context menu (when i right-click on a folder) an action to be executed and display the output to the user, inside, let's say, a text area window with a vertical scrolling bar. Suppose, that the action is just a shell script that executes a "find" command inside the given directory, searching for a specified pattern.
I have managed to implement it, up to this point, using Automator. What I cannot do is to pipe the output in a synchronous fashion (what is meant by "synchronous" is to have the output print to the user when is produced by the "find" command, and not after the command has finished) in a GUI.
I have spent sometime searching on this and I have come to the conclusion that XCode and Interface Builder have to be put into the play? Am I on the right track? Is there a straightforward and simple way in succeeding in this without having to dig into this framework?
Thank you very much,
Babis
You can have the shell script throw a dialog when it gets the result using http://cocoadialog.sourceforge.net/

Resources