AutoHotkey Community

It is currently May 26th, 2012, 12:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 19th, 2008, 4:15 pm 
Offline

Joined: November 29th, 2008, 12:35 am
Posts: 111
Location: United Kingdom
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
Image


Last edited by menaphus on December 19th, 2008, 5:32 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 19th, 2008, 4:31 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
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.

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 19th, 2008, 5:31 pm 
Offline

Joined: November 29th, 2008, 12:35 am
Posts: 111
Location: United Kingdom
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 6:16 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
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 FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 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