AutoHotkey Community

It is currently May 27th, 2012, 10:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: June 23rd, 2006, 10:39 am 
Quote:
Purpose: CLIPREAD.EXE is a DOS utility that reads text from
the Windows clipboard and prints it to the DOS standard
output. CLIPREAD is run from within a Windows DOS box
or from the Windows command line. The output from
CLIPREAD may be redirected to a file.

Usage: CLIPREAD [/q] [> file]

Options: The /q option suppresses output messages.

Examples: CLIPREAD > CLIP.TXT

copies the contents of the Windows clipboard to the
file CLIP.TXT.

CLIPREAD

prints the contents of the clipboard to the screen.


Notes: CLIPREAD runs from the DOS prompt under Windows 3.0 or
above. Windows must run in 386 Enhanced mode for the
clipboard to be available to DOS programs. Since the
clipboard is shared among other Windows programs, you
may occasionally get a message that the clipboard is not
available.

CLIPREAD reads only text from the clipboard. Binary
data is not supported.

The Windows command line (the Run... option under the
Program Manager File menu) does not support output
redirection. To run CLIPREAD from the command line,
you must invoke the DOS command processor. For
example,

COMMAND /C CLIPREAD > CLIP.TXT

runs COMMAND.COM to properly redirect the output from
CLIPREAD to the file CLIP.TXT. If you run a batch
file containing a CLIPREAD command, you do not need
this special syntax.

[Download]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 5th, 2006, 9:12 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
it is much better to use 1 app for the clipboard then 2

winclip.exe can both read or write to the clipboard

if you need something fast, without parameters that support redirectin, use cb.exe

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 5th, 2006, 5:55 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Cannot we do all these with a few lines of AHK code?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2006, 8:01 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
No we can't

Console applications must be small and fast as you are going to execute them in batch scripts (and loops !). AHK is big and slow in that environment since console script should consist of regular commands and/or 3th party utilities that can compite in the speed of internal commands.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2006, 4:16 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Have you tried? A compiled AHK script is around 200KB, loads and runs without noticeable delay. Unless you run it in a really long loop (which makes no sense with a ClipBoard processing utility), you should not be able to tell the difference. And you can do really fancy things with the AHK version, like TrayTip showing progress, MsgBoxes, InputBoxes, or complete GUI's.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2006, 8:26 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
200KB ?

That is large. CB is 20K

It is not all about the speed. I usualy care about programming principles. Thats way I created GuiBox that has about 100 parameters and it creates menus on the fly from the command line, is done in API, and is 70K size, since I don't want to use AHK for batch scripts, and I don't want to use separate files for GUIs. Also, batch script usualy need only basic GUIs.


Quote:
And you can do really fancy things with the AHK version, like TrayTip showing progress, MsgBoxes, InputBoxes, or complete GUI's.


Code:
GuiBox /H0 thinger - "Executing batch script" 5
GuiBox /A20 /T /P6 /Q0 /B edit Title, Prompt, Default Text >out
if ErrorLevel exit
Set /P ANS=<out
...

I like to do it on the fly, as I need the GUI

First command will hide the console window so you will never see batch script if you place this command as the first line (/H0) and will show tray tooltip with the message and close it after 5 seconds.

Second command will create 20% transparent dialog (/A20) on top (/T), on mouse position (/P6) with 0 buttons (/Q0) without title (/B) that will prompt you something and put your answer on the console where it will be grabed in ANS variable. If user pressed ESC ErrorLevel will be set to 1

I can also create progress, since you can communicate with active instance of GuiBox via other instances of GuiBox. This will show you the time from the tray.
Code:
 
start Guibox /NmyGui thinger - "%time%"

:loop
   sleep 1
   GuiBox /[myGui set(%time%)]
    if (exit condition) GuiBox /[myGui die]
goto loop


Those are some things that you regulary need in batch but AHK is overkill.
I created all kind of common GUIS (browser for folder/files, edit, combo, listview...). It is designed to be extremely fast and not to use any resources.

This is cool:
dir | GuiBox thinger - +

will show you the content of the directory from the tray menu :)
You can't compete AHK with this in batch environment.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group