AutoHotkey Community

It is currently May 24th, 2012, 8:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: March 13th, 2007, 11:17 pm 
Offline

Joined: March 13th, 2007, 11:09 pm
Posts: 2
I am trying to add a suspend and a close command to this script, so I can have it running with others that won't work with it.

I tried adding these lines
Code:
!`::Suspend
^!=::ExitApp

When I run the script with the above lines, I get "No Clip Exists" when I press Ctrl-C to create a new clip and when I press Ctrl-V to paste.

Any ideas why my Suspend and ExitApp hotkeys would break the script?

Thanks.
slmndr


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2007, 12:17 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Where did you put those lines?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2007, 4:02 am 
Offline

Joined: March 13th, 2007, 11:09 pm
Posts: 2
jonny wrote:
Where did you put those lines?


In the wrong place. :wink:

It's always the last place you look isn't it?
Moved them to here (red):
Code:
$^v::
If numofclips<1
{
  tooltip=No clip exists
  Gosub,TOOLTIP
  delete=no
  paste=yes
  Return
}
If paste<>no
  Gosub,FINDNEXT
Gosub,SHOWCLIP
delete=no
paste=paste
Return

!`::Suspend
^!=::ExitApp


ADDCLIP:
readclip=filearray1
readclip:=%readclip%
lastclip=%readclip%
lastclip+=1
numofclips+=1
activeclip=1
IfExist,%lastclip%.clip
  FileDelete,%lastclip%.clip
FileAppend,%ClipboardAll%,%lastclip%.clip
Return

After all the Ctrl- combo handlers and just before the subroutines.

Everything works great now.

slmndr


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2007, 4:23 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
skrommel wrote:
ClipStep - Control multiple clipboards using only the keyboard's Ctrl-X-C-V

Select some text, press Ctrl-C to copy it to multiple new clipboards.
Now hold down Ctrl and press V repeatedly to step through the clipboards. C steps backwards.
When you've got the clipboard you want, release Ctrl to paste.
To delete a clipboard, hold down Ctrl, press V followed by X twice to delete, three times to delete all, or once to cancel. Release Ctrl to accept.

The clipboards are saved to separate files, so place the script in it's own folder.

Skrommel


Without this explanation, a user would be unable to use the clipstep.exe from this website.

http://www.donationcoder.com/Software/Skrommel/

There is no explantion. A user would have to get lucky and find this thread.

I have another suggestion ... it would be nice if the "Copy" command from selecting text ... right clicking on text and selecting "copy" was supported.

My brain seems to copy with the right click method for URLs in browsers and filenames in Windows Explorer. I don't know why :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2007, 10:28 pm 
Offline

Joined: March 17th, 2007, 7:51 pm
Posts: 45
Location: San Antonio, TX
awesome script!!!, i was going to make something similar still might, but i work for online tech support and i contastly have to switch between windows to move information over this will save me alot of time and effort TY VM


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Really I like it!
PostPosted: September 15th, 2008, 1:32 pm 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
:D Really Ilike this made of way; At the beginning it's so strange. And After so good so well so merveillouse!
great thanks for skrommel
PS:It's very interressant, i don(t understand everything,but it's so practical!
I wan't to work with this way of doing :)

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: file copying
PostPosted: October 10th, 2008, 9:07 pm 
Very old thread, but I still find this very useful...

lowbatteries wrote:
If I hit ctrl+c on a file, I get the tooltip "empty selection", where as if I use ctrl+x, it saves it as a clip and I can then paste it (works as it does in windows).

Currently, copying files with ctrl+c is effectively broken while running the script, but I can use the ctrl+insert and shift+insert mentioned by peepsalot. I had no clue those shortcuts existed.


To correct this bug, simply add "ClipWait,1" after the "Send,^c" line, like it's done for Ctrl-X. The file will then be copied properly.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2009, 9:03 pm 
Old topic I know but I've just discovered this awesome script. So simpel yet so effective. THANKS!

Should be standard in windows.


Report this post
Top
  
Reply with quote  
PostPosted: August 9th, 2010, 4:23 pm 
Offline

Joined: July 28th, 2010, 10:38 pm
Posts: 42
I add this:

clip2:=ClipboardAll
If clip1<>%clip2%
{
Gosub,ADDCLIP
Gosub,INDEX
}
clip1:=clip2

to the beginning of $^v::, in hopes of adding anything that is copied to the clipboard via the context menu copy/cut. So, it adds the text to the clip database, but if i press the hotkey again, it'll add the same text. Did I miss something, or does my last line and the if statement i copied from $^c:: not handle repeated test.

thanks in advance.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2010, 2:53 am 
You should use ClipWait.

Here's a script I threw up quickly, I think it does a much better job.
Handles anything copied to clipboard (not only via Ctrl-V)

You can retrieve clipboard number, active app when it was created and content via Shift-Ctrl-V

You can set how much clipboard you want to store in the first lines of script (max).

Unfortunately, it crashes from time to time :(
If someone is able to spot why (or can optimize it any way), well great !!

Enjoy ;)


Code:
#SingleInstance force
#Persistent
#NoEnv
Menu, TRAY, icon, %A_WinDir%\system32\SHELL32.dll, 48
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
max = 4
Return

OnClipboardChange:
If nochange or !A_EventInfo
    nochange=0
Else {
    num3=0   
    num++
    If num=%max%
        num=1       
    WinGet, app%num%, ProcessName, A
    IfInString, app%num%, .exe
    {
        StringGetPos, pos, app%num%, .exe
        StringLeft, app%num%, app%num%, pos
    }
    clip%num% := ClipboardAll
}
Return

^+v::
if !num3
    num2 := num
num3 = 1
num2--
If !num2
    num2:=max-1
nochange=1
clipboard := clip%num2%
StringLeft,clip0,Clipboard,200
If (StrLen(Clipboard) > 200)
    clip0=%clip0%...
texte = % "#" . num2 . " - " . app%num2% . ":`n" . clip0
ToolTip, %texte%
SetTimer, TT, 2000
Return

TT:
SetTimer, TT, Off
ToolTip
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2010, 2:55 am 
Also, if someone knows how to retrieve the file content type (picture, audio, etc.), that would be a nice addition as well.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2010, 2:19 am 
Offline

Joined: April 30th, 2006, 6:23 pm
Posts: 358
Location: Shigle Springs
Chris wrote:
While reading another topic, I'd forgotten about the script above so wrote the below. Here it is in case it's of use to anyone or if there's anything of merit that can be combined with the one above:
Code:
; This script keeps a record of the clipboard contents so that in effect, you have
; more than one clipboard.  To restore the old clipboards (one by one), press the
; Win+Space or Shift+Win+Space hotkeys (or other hotkeys as configured below).
; The script give you feedback about what's on the clipboard via Tooltips.

; CONFIGURATION SECTION. SET YOUR PREFERENCES HERE:
MaxClipboards = 5  ; How many clipboards to maintain in the list.
HotkeyBack = #space  ; Hotkey to move backward through the list of clipboards.
HotkeyFwd = #+space  ; Hotkey to move forward through the list of clipboards.

; END OF CONFIGURATION SECTION

Hotkey, %HotkeyBack%, HotkeyBack
Hotkey, %HotkeyFwd%, HotkeyFwd

#Persistent
ClipIndex = 0
ClipIndexToRestore = 0

OnClipboardChange:
if (A_EventInfo = 0 OR NoSaveClipboard)
   return  ; Empty or the hotkey told us not to save its own change to the clipboard.
; Check if what's on the clipboard now exactly matches the previously saved item. If it
; does, don't save it.  This solves the fact that some apps save each clipboard twice.
if ClipIndex > 0
{
   ClipSavedTemp := ClipboardAll  ; ...because can't compare directly to ClipboardAll.
   if ClipSaved%ClipIndex% = %ClipSavedTemp%  ; Must be old-style if-statement.
      return
}
ClipIndex += 1  ; Move to the next slot.
if (ClipIndex > MaxClipboards)  ; Wrap back around to the beginning.
   ClipIndex = 1
ClipIndexToRestore := ClipIndex  ; Reset the hotkey's bookmark each time a save occurs.
ClipSaved%ClipIndex% := ClipboardAll  ; Save the current contents of the clipboard.
ToolTip, %ClipIndex%, A_CaretX, A_CaretY  ; Briefly notify the user of the item number.
SetTimer, ToolTipOff, 1000
return

HotkeyBack:
HotkeyFwd:
if ClipIndexToRestore = 0  ; No saved clipboards yet.
   return
if (A_ThisHotkey = HotkeyBack)
{
   ClipIndexToRestore -= 1  ; Move backward through the list.
   if ClipIndexToRestore <= 0  ; Wrap around to the tail end of list.
      ClipIndexToRestore := MaxClipboards
}
else  ; (A_ThisHotkey = HotkeyFwd)
{
   ClipIndexToRestore += 1  ; Move forward through the list.
   if ClipIndexToRestore > %MaxClipboards%  ; Wrap around to beginning or list.
      ClipIndexToRestore := 1
}
if StrLen(ClipSaved%ClipIndexToRestore%) = 0  ; Nothing saved, so don't do it.
{
   ToolTip Restored Clipboard #%ClipIndexToRestore% is empty., A_CaretX, A_CaretY
   SetTimer, ToolTipOff, 2000
   return
}
NoSaveClipboard := true  ; Tell OnClipboardChange not to save our clipboard change.
Clipboard := ClipSaved%ClipIndexToRestore%
ToolTip Restored Clipboard #%ClipIndexToRestore%:`n%Clipboard%, A_CaretX, A_CaretY
SetTimer, ToolTipOff, 2000
Sleep 30  ; This gives the OnClipboardChange subroutine an opportunity to run.
NoSaveClipboard := false
return

ToolTipOff:
ToolTip
SetTimer, ToolTipOff, Off
return


Ya know what???
I would kill or die to see a combo of these two scripts.. Chris's and the first post here.
Chris's does it upon clipboard change. Very smart, not limited to Ctrl C. (I use the mouse half the time)
Chris's also shows more of what is on the clipboard.
The first post is more user friendly. Just Ctrl V and scroll through, (oh wait, I use the mouse too sometimes, what then? :roll: .. Oh well, I could get used to using only Ctrl V so I can scroll, but Chris's Copy from anything in the clipboard is better.)

But, yes, after using it for a few min, I realized that it is very important to add the clip file whenever and however a clipboard is added, but the Ctrl V is most user friendly.

Does anyone know how to combine the two?
Chris's is well documented but the other is not and I am not that smart. So any help would be much loved. :wink:

_________________
CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 3:24 am 
well, what about mine, in the post just above yours ;)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2011, 3:23 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 335
I modified Chris' script to only rotate through used clips up to MaxClipboards.

Code:
; This script keeps a record of the clipboard contents so that in effect, you have
; more than one clipboard.  To restore the old clipboards (one by one), press the
; Win+Space or Shift+Win+Space hotkeys (or other hotkeys as configured below).
; The script give you feedback about what's on the clipboard via Tooltips.

; CONFIGURATION SECTION. SET YOUR PREFERENCES HERE:
MaxClipboards = 5  ; How many clipboards to maintain in the list.
HotkeyBack = #space  ; Hotkey to move backward through the list of clipboards.
HotkeyFwd = #+space  ; Hotkey to move forward through the list of clipboards.

; END OF CONFIGURATION SECTION

HotkeyBack:
HotkeyFwd:
if ClipIndexToRestore = 0  ; No saved clipboards yet.
   return
   MaxClipIndex := ClipIndex > MaxClipboards ? ClipIndex : MaxClipboards
if (A_ThisHotkey = HotkeyBack)
{
   ClipIndexToRestore -= 1  ; Move backward through the list.
   if ClipIndexToRestore <= 0  ; Wrap around to the tail end of list.
      ClipIndexToRestore := MaxClipIndex
}
else  ; (A_ThisHotkey = HotkeyFwd)
{
   ClipIndexToRestore += 1  ; Move forward through the list.
   if ClipIndexToRestore > %MaxClipIndex% ; Wrap around to beginning or list.
      ClipIndexToRestore := 1
}
if StrLen(ClipSaved%ClipIndexToRestore%) = 0  ; Nothing saved, so don't do it.
{
   ToolTip Restored Clipboard #%ClipIndexToRestore% is empty., A_CaretX, A_CaretY
   SetTimer, ToolTipOff, 2000
   return
}
NoSaveClipboard := true  ; Tell OnClipboardChange not to save our clipboard change.
Clipboard := ClipSaved%ClipIndexToRestore%
ToolTip Restored Clipboard #%ClipIndexToRestore%:`n%Clipboard%, A_CaretX, A_CaretY
SetTimer, ToolTipOff, 2000
Sleep 30  ; This gives the OnClipboardChange subroutine an opportunity to run.
NoSaveClipboard := false
return

ToolTipOff:
ToolTip
SetTimer, ToolTipOff, Off
return


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 21st, 2011, 12:44 am 
Offline

Joined: July 28th, 2010, 10:38 pm
Posts: 42
I've compiled the original ClipSteop so that I can run it om my USB flash drive. However, I noticed something very strange. The data files that holds the multiple clipboards (1.clip 2.clip .... whatever number pieces of info you have copied) are not saved in the save directory as the script.

Basically I use a program called restart_on_crash to start and maintain some of my background apps, but instead of saving the clipboard data in the script directory, it is saved in restart_on_crash's directory. So the data is saved in the directory of the program that launches the script. This greatly confuses me since all restart_on_crash does is check if if a given program(s) is running/responding, and if not, kills that program(s) and then execute a command, which most people choose to be the program that was just closed.

Any suggestions on how to fix this is appreciated.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, lblb, Rajat, Scratch and 25 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