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 

Abbreviation Expander v1.0

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



Joined: 28 Nov 2008
Posts: 111
Location: United Kingdom

PostPosted: Fri Dec 19, 2008 3:15 pm    Post subject: Abbreviation Expander v1.0 Reply with quote

Here it is
It will:
Download Ahk if you dont already have
Save Inputed abbreviations in an ahk file ready for execution and will automaticaly expand these into full words when run.
The .AHK with the abbreciations in will be saved in the same folder as the main app
The expanding file will be made in the same directory when an input is added for the first time
Code:

; AutoHotkey Version:   1.x
; Language:      English
; Platform:         Win9x/NT
; Author:         A.T.Fieldhouse <kermit.the.frog93@gmail.com>
; File type:             exe/ahk
#NoEnv
#SingleInstance
SetWorkingDir,  %A_ScriptDir%
;-------------------------------------------GUI----------------------------------------------------------
Gui, Add, Text,, Press Alt + H to hide Alt + S to re-show or esc to exit.
Gui, Add, Text,, Please enter the abbreviation here.
Gui, Add, Edit, vAbAddName
Gui, Add, Text,, Please enter the full phrase here.
Gui, Add, Edit, vFullAddName
Gui, Add, Button, Default, Add
Gui, Add, Button,, Hide
Gui, Show
Return
;----------------------------------ADD TO VAR LOGG-------------------------------------------
ButtonADD:
IfNotExist, AbbreviationData.ahk
{
GoSub, ADD1
}
else
{
GoSub, ADD2
}
Return

ADD1:
Gui,Submit,Nohide
FileAppend ,
(
::%AbAddName%::%FullAddName%
), AbbreviationData.ahk
MsgBox, The abbreviation entered has been saved in %A_ScriptDir%AbbreviationData.ahk .
Reload
Return
Return

ADD2:
Gui,Submit,Nohide
FileAppend ,
(

::%AbAddName%::%FullAddName%
), AbbreviationData.ahk
MsgBox, The abbreviation entered has been added to the library.
Reload
Return
;---------------------------------------HOTKEYS-----------------------------------------------------
esc::ExitApp
!h::GoSub, ButtonHIDE
!s::GoSub, WINSHOW
;----------------------------------------------HIDE-----------------------------------------------------
ButtonHIDE:
WinHide, Abbreviation replacer.ahk
return
;--------------------------------------------SHOW-----------------------------------------------------
WINSHOW:
WinShow, Abbreviation replacer.ahk
return
NOTE: Save the file as Abbreviation replacer.ahk
_________________
Adam
http://moourl.com/8w0tx


Last edited by menaphus on Fri Dec 19, 2008 4:32 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SoggyDog



Joined: 02 May 2006
Posts: 783
Location: Greeley, CO

PostPosted: Fri Dec 19, 2008 3:31 pm    Post subject: Re: Abbreviation Expander v1.0 Reply with quote

menaphus wrote:
Code:
;---------------------------------CHECK FOR AHK(DOWNLOAD)--------------------------
If( Not FileExist( "AutoHotkey.exe")){
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKey
}

A bit of logic here...
If you don't already have AHK installed, this script will never run and therefore not download AHK.
If it's compiled, then you don't need it anyway.

Further, this line ...
Code:
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKey

... should read ...
Code:
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKeyInstall.exe


Further, still, your script doesn't consider the installation path of where AHK may already be installed and it downloads the file every time you run the script.
_________________

SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
menaphus



Joined: 28 Nov 2008
Posts: 111
Location: United Kingdom

PostPosted: Fri Dec 19, 2008 4:31 pm    Post subject: Re: Abbreviation Expander v1.0 Reply with quote

SoggyDog wrote:
menaphus wrote:
Code:
;---------------------------------CHECK FOR AHK(DOWNLOAD)--------------------------
If( Not FileExist( "AutoHotkey.exe")){
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKey
}

A bit of logic here...
If you don't already have AHK installed, this script will never run and therefore not download AHK.
If it's compiled, then you don't need it anyway.

Further, this line ...
Code:
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKey

... should read ...
Code:
UrlDownloadToFile, http://www.autohotkey.com/download/AutoHotkeyInstall.exe, AutoHotKeyInstall.exe


Further, still, your script doesn't consider the installation path of where AHK may already be installed and it downloads the file every time you run the script.

=P ok ill remove it and add it in the next version cuz im adding more things it can do

anyone want to pick anymore holes? or any suggestions?
_________________
Adam
http://moourl.com/8w0tx
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Fri Dec 19, 2008 5:16 pm    Post subject: Reply with quote

You might be interest in this one:
Use shortcut text realtime
http://www.autohotkey.com/forum/topic86.html
Also look at Normands' script which reads abbreviations from
an ini file which can be edited via a nice gui (catena) for some
inspiration
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
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