 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
menaphus
Joined: 28 Nov 2008 Posts: 111 Location: United Kingdom
|
Posted: Fri Dec 19, 2008 3:15 pm Post subject: Abbreviation Expander v1.0 |
|
|
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 |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 783 Location: Greeley, CO
|
Posted: Fri Dec 19, 2008 3:31 pm Post subject: Re: Abbreviation Expander v1.0 |
|
|
| 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 |
|
 |
menaphus
Joined: 28 Nov 2008 Posts: 111 Location: United Kingdom
|
Posted: Fri Dec 19, 2008 4:31 pm Post subject: Re: Abbreviation Expander v1.0 |
|
|
| 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 |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| 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
|