AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sigswitch: paste a random signature from a file

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  

Please choose one:
I will test this
0%
 0%  [ 0 ]
interesting, I might test this later
0%
 0%  [ 0 ]
please make this more user friendly
0%
 0%  [ 0 ]
not interested
100%
 100%  [ 1 ]
I'd prefer cowboy McNeal's grandmother
0%
 0%  [ 0 ]
Total Votes : 1

Author Message
HelgeFin



Joined: 04 Apr 2007
Posts: 12

PostPosted: Sun Jul 20, 2008 8:40 am    Post subject: Sigswitch: paste a random signature from a file Reply with quote

Hi!

This is my fast hack of a random signature paster, which I named sigswitch.ahk.
Now, AHK-gurus, I am happy about any improvements!

Possible improvements:
* get rid of the need to put the number on the first line
* support multi-line signatures
* don't randomize but instead one sig after another
* make it user friendly for people not familiar with AHK and make an sigswitch.exe



Usage:
The file
Quote:
C:\Dokumente und Einstellungen\h\Eigene Dateien\My Dropbox\MyScripts\sigs.txt

needs to contain your signature (and probably you want to change this path which is found twice in the code). The first line must contain the number of signatures. Example of sigs.txt :

Quote:
2
Come join me on Twitter.com!
There's A REASON Why Atheists Don't Fly Planes Into Buildings


Exchange "Smile Helge" by your always showing part of the signature.

now type "s#" to paste your random signature

Code:

#Hotstring *ROC

::s#::
   tmp=%Clipboard%
   clipboard=  ; Start off empty to allow ClipWait to detect when the text has arrived.
        FileReadLine, maxX, C:\Dokumente und Einstellungen\h\Eigene Dateien\My Dropbox\MyScripts\sigs.txt,1
        clipboard=
( ` % Join`r`n
:) Helge


)

   random,randX,1,%maxX%
   randX+=1
   FileReadLine, addX, C:\Dokumente und Einstellungen\h\Eigene Dateien\My Dropbox\MyScripts\sigs.txt, %randX%
      
   clipboard:=clipboard . addX

   ClipWait  ; Wait for the clipboard to contain text.
   Send,^v
   Sleep,100
   Clipboard=%tmp%

        return


License: Public domain

Smile Helge

http://www.facebook.com/home.php#/profile.php?id=627364227
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group