AutoHotkey Community

It is currently May 27th, 2012, 4:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: June 11th, 2009, 7:59 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
meant to post above under my handle, but got auto-logged off without noticing...

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2009, 5:42 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
OK, finally figured it out I think. Here is my little innovation. Copy a comma or linefeed-separated list of items and they will be copied as separate clipboard entries by pressing Ctrl-Alt-3 and Ctrl-Alt-4. You may change the hotkeys to suit yourself of course. I also use Ctrl-Alt-mousewheel to roll forward and backward through the entries.

Code:
#SingleInstance force
#Persistent
Setkeydelay,1,1

;Pajenn's clipboard
Gosub,Msg
SendMode Input
handleClip("clear")

^!1::handleClip("clear")
^!2::handleClip("get")
^!WheelUp::handleClip("roll")
^!WheelDown::handleClip("rollforward")
^!3::Gosub,DuranDuran
^!4::Gosub,Bing
~^x::
~^c::
   ClipWait, 2
   Sleep, 50
   handleClip("save")
return

handleClip(action)
{
   static
   
   if (action = "save")
   {
      AddNextNum:= AddNextNum < 30 ? AddNextNum+1 : 1
      HighestNum+= HighestNum < 30 ? 1 : 0
      GetNextNum:= AddNextNum , ClipArray%AddNextNum% := Clipboard
   }
   else if ((action = "get") || (action = "roll")) && (GetNextNum != 0)
   {
      if (action = "roll")
         Send ^z
      Clipboard := ClipArray%GetNextNum%
      GetNextNum:= GetNextNum > 1 ? GetNextNum-1 : HighestNum   
      Send ^v
   }
   else if ((action = "rollforward") && (GetNextNum != 0))
   {
      Send, ^z
      GetNextNum:= GetNextNum < HighestNum ? GetNextNum+1 : 1
      Clipboard:= ClipArray%GetNextNum%
      Send, ^v
   }
   else if (action = "clear")
      GetNextNum:=0, AddNextNum=HighestNum=0
     else if (action = "write")
       loop, 15
       {
         If A_Index = 1
           FileAppend, `n%A_Now%`n, %A_ScriptDir%\ClipRing.txt
         If content:= ClipArray%A_Index%
           FileAppend, %content%`n, %A_ScriptDir%\ClipRing.txt
       }
}

DuranDuran:
ClipBoard =
Send,^c
Clipwait,1
Fonda = %ClipBoard%
Loop,Parse,Fonda, `n, `r
{
Autotrim,On
If A_LoopField =
Continue
If A_LoopField = %A_Tab%
Continue
Else
Clipboard = %A_LoopField%
handleClip("save")
Msgbox,,,Item added %A_LoopField%,.2
}
Return

Bing:
ClipBoard =
Send,^c
Clipwait,1
Fonda = %ClipBoard%
Loop,Parse,Fonda,`,
{
Autotrim,On
If Clipboard =
Continue
Clipboard = %A_LoopField%
handleClip("save")
Msgbox,,,Item added %A_LoopField%,.2
}
Return

;-------------------------------

^+Insert::Suspend
^!Escape::Exitapp


Report this post
Top
 Profile  
Reply with quote  
 Post subject: reverse get added
PostPosted: September 17th, 2009, 7:33 am 
i made a little change, "reverse get " added.

handleClip(action)
{
global static AddNextNum
global static GetNextNum
global static HighestNum
global static getprevnum
global static ClipArray
global static ClipArray1
global static ClipArray2
global static ClipArray3
global static ClipArray4
global static ClipArray5
global static ClipArray6
global static ClipArray7
global static ClipArray8
global static ClipArray9
global static ClipArray10
global static ClipArray11
global static ClipArray12
global static ClipArray13
global static ClipArray14
global static ClipArray15
global static ClipArray16
global static ClipArray17
global static ClipArray18
global static ClipArray19
global static ClipArray20
global static ClipArray21
global static ClipArray22
global static ClipArray23
global static ClipArray24
global static ClipArray25
global static ClipArray26
global static ClipArray27
global static ClipArray28
global static ClipArray29
global static ClipArray30

if (action = "save")
{
if (AddNextNum < 30)
{
AddNextNum += 1 ;
}
else
{
AddNextNum := 1 ;
}


if (HighestNum < 30)
{
HighestNum += 1 ;
}

GetNextNum := AddNextNum ;
ClipArray%AddNextNum% := Clipboard
highest1 := highestnum + 1
getprevnum := 1

}
else if ((action = "get") OR (action = "roll"))
{
if (GetNextNum != 0)
{
if (action = "roll")
{
Send, ^z
}
Clipboard := ClipArray%GetNextNum%
if (GetNextNum > 1)
{
GetNextNum -= 1 ;
getprevnum++
}
else
{
getprevnum := 1
GetNextNum := HighestNum

}
Send, ^v
}
}
else if (action = "get-reverse")
{
if (GetNextNum != 0)
{

Clipboard := ClipArray%getprevnum%
if (GetNextNum > 1)
{
GetNextNum -= 1 ;
getprevnum++
}
else
{
getprevnum := 1
GetNextNum := HighestNum

}
Send, ^v
}
}


else if (action = "rollforward")
{
if (GetNextNum != 0)
{
Send, ^z
if (GetNextNum < HighestNum)
{
GetNextNum += 1 ;
}
else
{
GetNextNum := 1
}
Clipboard := ClipArray%GetNextNum%
Send, ^v
}
}
else if (action = "clear")
{

GetNextNum := 0
AddNextNum := 0
HighestNum := 0
getprevnum := 0
}
}

#0::
handleClip("clear")
return

^c::
suspend on
Send, ^c
suspend off
handleClip("save")

return

#v::
handleClip("get")
return

#]::
handleClip("get-reverse")
return
#\::
handleClip("roll")
return

#^\::
handleClip("rollforward")
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2009, 1:55 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Hi, so that essentially gets the next item instead of the previous in the stack so you don't have to get and then roll back? Nice. I added another function, bignose to my version, one which lets you copy a whole mailing address, and each element (name, town, state, zip code) becomes an individual clipboard entry. May be good for things like web forms for instance.

Code:
BigNose:
ClipBoard =
Send,^c
Clipwait,1
Fonda = %ClipBoard%
Loop,Parse,Fonda,`,`n, `r
{
Autotrim,On
If A_LoopField =
Continue
Else
Clipboard = %A_LoopField%
handleClip("save")
Msgbox,,,Item added %A_LoopField%,.2
}
Return


Thank you for initiating this thread, Bjork. It's inspired me.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 22nd, 2009, 12:12 pm 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
bjork wrote:
Code:
Note that this only works for pure text, as I found that I couldn't store multiple ClipboardAll (looks like ClipboardAll can only be stored as a pointer to a single Clipboard object? Is that right?)


I felt the need of a clipboard manager like this but with ClipboardAll.

Guess what, you can use ClipboardAll too by adding another intervening variable to store the ClipboardAll data :)

Code:
handleClip(action)
{
  static
  if (action = "save")
  {
    AddNextNum:= AddNextNum < 15 ? AddNextNum+1 : 1
    HighestNum+= HighestNum < 15 ? 1 : 0
    Current := ClipboardAll
    GetNextNum:= AddNextNum, ClipArray%AddNextNum% := Current
  }
}


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 24th, 2009, 3:26 pm 
Offline

Joined: January 2nd, 2009, 2:56 am
Posts: 10
I love this script. It's simple and very useful.

I added to the hotkeys to use ctrl+the arrowkeys and delete and added a loop to clear the ClipArray... when handleClip("clear") is called.

Thanks!!!, Lee Studley


Code:
handleClip(action)
{
    global static AddNextNum
    global static GetNextNum
    global static HighestNum
    global static getprevnum
    global static ClipArray
    global static ClipArray1
    global static ClipArray2
    global static ClipArray3
    global static ClipArray4
    global static ClipArray5
    global static ClipArray6
    global static ClipArray7
    global static ClipArray8
    global static ClipArray9
    global static ClipArray10
    global static ClipArray11
    global static ClipArray12
    global static ClipArray13
    global static ClipArray14
    global static ClipArray15
    global static ClipArray16
    global static ClipArray17
    global static ClipArray18
    global static ClipArray19
    global static ClipArray20
    global static ClipArray21
    global static ClipArray22
    global static ClipArray23
    global static ClipArray24
    global static ClipArray25
    global static ClipArray26
    global static ClipArray27
    global static ClipArray28
    global static ClipArray29
    global static ClipArray30
   
    if (action = "save")
    {
    if (AddNextNum < 30)
    {
        AddNextNum += 1 ;
    }
    else
    {
        AddNextNum := 1 ;
    }
   
   
    if (HighestNum < 30)
    {
        HighestNum += 1 ;
    }
   
        GetNextNum := AddNextNum ;
        ClipArray%AddNextNum% := Clipboard
        highest1 := highestnum + 1
        getprevnum := 1
   
    }
    else if ((action = "get") OR (action = "roll"))
    {
    if (GetNextNum != 0)
    {
        if (action = "roll")
        {
            Send, ^z
        }
        Clipboard := ClipArray%GetNextNum%
        if (GetNextNum > 1)
        {
            GetNextNum -= 1 ;
            getprevnum++
        }
        else
        {
            getprevnum := 1
            GetNextNum := HighestNum
       
        }
        Send, ^v
        }
        }
        else if (action = "get-reverse")
        {
            if (GetNextNum != 0)
        {
       
        Clipboard := ClipArray%getprevnum%
        if (GetNextNum > 1)
        {
            GetNextNum -= 1 ;
            getprevnum++
        }
        else
        {
            getprevnum := 1
            GetNextNum := HighestNum
        }
        Send, ^v
        }
    }
   
   
    else if (action = "rollforward")
    {
        if (GetNextNum != 0)
        {
        Send, ^z
        if (GetNextNum < HighestNum)
        {
        GetNextNum += 1 ;
        }
        else
        {
            GetNextNum := 1
        }
            Clipboard := ClipArray%GetNextNum%
            Send, ^v
        }
    }
    else if (action = "clear")
    {
        GetNextNum := 0
        AddNextNum := 0
        HighestNum := 0
        getprevnum := 0
   
        Loop, 30
        {
            ClipArray%A_Index% :=
        }
        MsgBox, ClipboardQueue Cleared!
    }
}
;===================end of main area ========



#0::
^Del::
    handleClip("clear")
return

^c::
^Up::
    suspend on
    Send, ^c
    suspend off
    handleClip("save")

return

#v::
    handleClip("get")
return

#]::
^Down::
    handleClip("get-reverse")
return

#\::
    handleClip("roll")
return

#^\::
    handleClip("rollforward")
return


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 5th, 2010, 11:27 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
..:: Free Radical ::.. wrote:
bjork wrote:
Code:
Note that this only works for pure text, as I found that I couldn't store multiple ClipboardAll (looks like ClipboardAll can only be stored as a pointer to a single Clipboard object? Is that right?)


I felt the need of a clipboard manager like this but with ClipboardAll.

Guess what, you can use ClipboardAll too by adding another intervening variable to store the ClipboardAll data :)

Code:
handleClip(action)
{
  static
  if (action = "save")
  {
    AddNextNum:= AddNextNum < 15 ? AddNextNum+1 : 1
    HighestNum+= HighestNum < 15 ? 1 : 0
    Current := ClipboardAll
    GetNextNum:= AddNextNum, ClipArray%AddNextNum% := Current
  }
}


Works great! I copied and cycled through both text and images just fine in both Notepad++ and Irfanview. Wnen in NPP the images were just bypassed. This is great! It's working for music clips in my audio editor too!!!!

;-----------------------------------------------------

And just my opinion but more of the great things to come out of these here forums should be made into exes and offered to the gen'l public.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ClipCycler
PostPosted: April 28th, 2010, 11:42 am 
Hi, just wanted to let you know I developed a .NET application that does this and more:

http://sourceforge.net/projects/clipcycler

Enjoy!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 11 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