 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Is it usefull? |
| Yes |
|
75% |
[ 3 ] |
| No |
|
25% |
[ 1 ] |
|
| Total Votes : 4 |
|
| Author |
Message |
Sty!a
Joined: 31 Jan 2005 Posts: 65
|
Posted: Tue Feb 08, 2005 4:14 pm Post subject: Clipboardmanager |
|
|
This is my new script:
| Code: | IniRead, var1, store.ini, Saves, kvar1
IniRead, var2, store.ini, Saves, kvar2
IniRead, var3, store.ini, Saves, kvar3
IniRead, var4, store.ini, Saves, kvar4
IniRead, var5, store.ini, Saves, kvar5
IniRead, var6, store.ini, Saves, kvar6
IniRead, var7, store.ini, Saves, kvar7
IniRead, var8, store.ini, Saves, kvar8
IniRead, var9, store.ini, Saves, kvar9
gui, -caption
Gui, Add, ListBox, vStand x6 y7 w130 h130, Slot1|Slot2|Slot3|Slot4|Slot5|Slot6|Slot7|Slot8|Slot9|
Gui, Add, Button, x146 y7 w100 h30, Show
Gui, Add, Button, x146 y47 w100 h30, Save
Gui, Add, Button, x146 y87 w100 h30, Restore
Gui, Add, Button, x146 y147 w100 h30, Close
Gui, Add, Picture, x16 y147 w110 h90, clipboardmanager.gif
refresh:
Gui, Add, Text, vMyText x146 y187 w100 h50,
Gui, Show, x270 y110 h252 w252,
SetTimer, UpdateContent, 1
return
UpdateContent:
GuiControlGet, Stand
If Stand = Slot1
{
Content = %var1%
}
If Stand = Slot2
{
Content = %var2%
}
If Stand = Slot3
{
Content = %var3%
}
If Stand = Slot4
{
Content = %var4%
}
If Stand = Slot5
{
Content = %var5%
}
If Stand = Slot6
{
Content = %var6%
}
If Stand = Slot7
{
Content = %var7%
}
If Stand = Slot8
{
Content = %var8%
}
If Stand = Slot9
{
Content = %var9%
}
GuiControl,,MyText,%content%
return
ButtonShow:
GuiControlGet, Stand
If Stand = Slot1
{
MsgBox, %var1%
}
If Stand = Slot2
{
MsgBox, %var2%
}
If Stand = Slot3
{
MsgBox, %var3%
}
If Stand = Slot4
{
MsgBox, %var4%
}
If Stand = Slot5
{
MsgBox, %var5%
}
If Stand = Slot6
{
MsgBox, %var6%
}
If Stand = Slot7
{
MsgBox, %var7%
}
If Stand = Slot8
{
MsgBox, %var8%
}
If Stand = Slot9
{
MsgBox, %var9%
}
return
;saves The content
ButtonSave:
GuiControlGet, Stand
If Stand = Slot1
{
var1=%clipboard%
}
If Stand = Slot2
{
var2=%clipboard%
}
If Stand = Slot3
{
var3=%clipboard%
}
If Stand = Slot4
{
var4=%clipboard%
}
If Stand = Slot5
{
var5=%clipboard%
}
If Stand = Slot6
{
var6=%clipboard%
}
If Stand = Slot7
{
var7=%clipboard%
}
If Stand = Slot8
{
var8=%clipboard%
}
If Stand = Slot9
{
var9=%clipboard%
}
return
;restores the content
ButtonRestore:
GuiControlGet, Stand
If Stand = Slot1
{
clipboard=%var1%
}
If Stand = Slot2
{
clipboard=%var2%
}
If Stand = Slot3
{
clipboard=%var3%
}
If Stand = Slot4
{
clipboard=%var4%
}
If Stand = Slot5
{
clipboard=%var5%
}
If Stand = Slot6
{
clipboard=%var6%
}
If Stand = Slot7
{
clipboard=%var7%
}
If Stand = Slot8
{
clipboard=%var8%
}
If Stand = Slot9
{
clipboard=%var9%
}
return
ButtonClose:
IniWrite, %var1%, store.ini, Saves, kvar1
IniWrite, %var2%, store.ini, Saves, kvar2
IniWrite, %var3%, store.ini, Saves, kvar3
IniWrite, %var4%, store.ini, Saves, kvar4
IniWrite, %var5%, store.ini, Saves, kvar5
IniWrite, %var6%, store.ini, Saves, kvar6
IniWrite, %var7%, store.ini, Saves, kvar7
IniWrite, %var8%, store.ini, Saves, kvar8
IniWrite, %var9%, store.ini, Saves, kvar9
ExitApp
return |
This is a clipboard manager you can save things from your clipboard to the slots and restore them.(Works only with text) _________________
Th!s !s STYLE |
|
| Back to top |
|
 |
Jon
Joined: 28 Apr 2004 Posts: 349
|
|
| Back to top |
|
 |
Sty!a
Joined: 31 Jan 2005 Posts: 65
|
Posted: Wed Feb 09, 2005 2:23 pm Post subject: |
|
|
Thx.
Yo, you're right i didn't knew that you made one.  _________________
Th!s !s STYLE |
|
| Back to top |
|
 |
Sty!a
Joined: 31 Jan 2005 Posts: 65
|
Posted: Wed Feb 09, 2005 2:26 pm Post subject: |
|
|
But i found a bug.
when you have s.th. in a slot, and you close the script it saved in the ini.
But if it has more the 1 line it's not correctly loaded.
I didn't found a way to fix it.
Can sombody fix it???  _________________
Th!s !s STYLE |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Wed Feb 09, 2005 3:59 pm Post subject: |
|
|
Darnit. This is way too similar to a script I've been working on for a while now. We gotta set up an AHK patent office. Don't worry, though, I was going in a different direction with it anyway. Great concept, nice to finally see this covered by AHK. |
|
| Back to top |
|
 |
Sty!a
Joined: 31 Jan 2005 Posts: 65
|
Posted: Thu Feb 10, 2005 1:08 pm Post subject: |
|
|
Thx johnny but my f*** bug  _________________
Th!s !s STYLE |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Fri Feb 11, 2005 6:45 pm Post subject: |
|
|
| Sty!a wrote: | | when you have s.th. in a slot, and you close the script it saved in the ini. But if it has more the 1 line it's not correctly loaded. | I haven't worked with ini files much, but it looks like you have to translate `r`n to some special characters to preserve them when writing to an ini. For example:
StringReplace, var1, var1, `r`n, ``n, All ; Do this prior to IniWrite.
StringReplace, var1, var1, ``n, `r`n, All ; Do this after IniRead. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|