AutoHotkey Community

It is currently May 27th, 2012, 1:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: June 26th, 2005, 1:47 pm 
Offline

Joined: June 26th, 2005, 11:31 am
Posts: 5
Hotstring helper designed by Andreas Borutta mentioned in Autohotkey help WORKS FINE IN THE *.AHK but once i compile it to *.exe it doesn't function!!! i wish to know the reason.


Last edited by RAMI on June 27th, 2005, 4:17 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 4:27 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The hotstring helper directly edits the script that contains it. For a compiled script, it has no access to the script so it can't make any changes.

I don't think there's an easy solution for this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 7:35 am 
Offline

Joined: June 26th, 2005, 11:31 am
Posts: 5
Thanks for replying

I don't think there's an easy solution for this.

DO u have an idea or a hint on how to solve it?
and what kind of command i need to read about so i can solve it?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 4:14 pm 
Offline

Joined: June 26th, 2005, 11:31 am
Posts: 5
Hi chris
I Have an idea but it is not clear enough.

The Following compiled script creates a New hotstring file contains this phrase:
::btw`::by the way`n:

FileInstall, C:\Program Files\AutoHotkey\AutoHotkey.exe, %temp%\AutoHotkey.exe
FileAppend, `::btw`::by the way`n, New Hotstrings.ahk
Run %temp%\AutoHotkey.exe "New Hotstrings.ahk"

while this script CAN auto compile *.AHK file:

Code:
Code:

; Include this code at the beginning of a script to provide self-compiling functionality.
; When the .ahk file is run it will prompt to compile, but the .exe will run as intended.
;
; You can set the following compile parameter variables:
; OUT    optional folder path (create exe with same name as script in that folder),
;        or full path including a different exe name if required.
; ICON   optional path & name of an icon file, default is AutoHotkey icon.
; PASS   optional password to encrypt the script within the exe.
;
; Example:
; OUT=D:\Temp\
; ICON=C:\Windows\System\Icons\Setup.ico
; PASS=encrypt
; #include,!compile.ahk
;
IfInString,A_ScriptName,.ahk
{
  StringTrimRight,name,A_ScriptName,4
  RegRead,cmd,HKEY_CLASSES_ROOT,AutoHotkeyScript\Shell\Compile\Command
  StringTrimRight,cmd,cmd,4
  IfEqual,out,,StringReplace,out,A_ScriptFullPath,.ahk,.exe ; default to same folder & name
  IfNotInString,out,.exe,SetEnv,out,%out%\%name%.exe ; same name in specified folder
  StringReplace,out,out,\\,\,All
  SetEnv,cmd,%cmd%  "%A_ScriptFullPath%" /out "%out%"
  SetEnv,msg,Input`t`t%A_ScriptFullPath%`nOutput`t`t%out%
  If icon>
  {
    SetEnv,cmd,%cmd% /icon "%icon%"
    SetEnv,msg,%msg%`nIcon`t`t%icon%
  }
  If pass>
  {
    SetEnv,cmd,%cmd% /pass "%pass%"
    SetEnv,msg,%msg%`nPassword`t`t%pass%
  }
  MsgBox,1,Compile this script?,%msg%
  IfMsgBox,ok,Run,%cmd%
  Exit
}

What if we let the hotspring helper in the help forum to save the entries in a created *.AHK file then the AHK file,, auto compile it self and replace the original hotstring helper compiled script..

DO u think it is possible?
DO u have another idea?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 11:45 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
RAMI wrote:
What if we let the hotspring helper in the help forum to save the entries in a created *.AHK file then the AHK file,, auto compile it self and replace the original hotstring helper compiled script.
It might work. But I don't think the main Hotstring Helper script should be changed to compile itself because most users would not want that.

By the way, compiling a script does not improve its performance. But perhaps you have other reasons for compiling it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2007, 9:38 am 
Offline

Joined: May 11th, 2007, 1:08 pm
Posts: 26
I have the same problem. Due to mobilty, I would like to compile my script, however, I still would like to modify the existing hotstrings during runtime.
Currently I am thinking on a solution, where I put all the hotstrings in a separate file, and the script might read all the hotstrings from this file. Is it possible? I couldn't get to a working version, but theoritically, it is possible, right? Any idea?

Thank you in advance,
Avalon

Ps.: I reviewed Adam Pash's Texter, but that's more then I could accomplish.

_________________
dA Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2007, 10:30 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Avalon wrote:
Currently I am thinking on a solution, where I put all the hotstrings in a separate file, and the script might read all the hotstrings from this file. Is it possible?


1) Copy Andreas Borutta's script into a file named AutoHotkey.INI
2) Copy AutoHotkey.exe ( from autohotkey folder ) and rename it to HotStrings.exe
3) HotStrings.exe and AutoHotkey.INI both should be placed in the same folder ( .. maybe in a USB stick )

That is it! You have a portable HotString Helper without compiling.
You just have to call HotString.EXE and the Hotstring Helper will automatically load.

I just gave it a rough try and it seems to work.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 3:34 pm 
Offline

Joined: May 11th, 2007, 1:08 pm
Posts: 26
It seems to be OK, however, I am looking something I can code. I mean this is a possible solution, but I would prefer to write something on my own - with some help of course.

Thanks the idea though. :)

_________________
dA Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 3:47 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Avalon wrote:
It seems to be OK, however, I am looking something I can code. I mean this is a possible solution, but I would prefer to write something on my own - with some help of course.


Is Mr.Green H troubling you ? :D
I do not see any other advantage of having your own compiled exe.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 4:15 pm 
To get a starting point, you could take a look here http://www.autohotkey.com/forum/topic20922.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 5:32 pm 
Offline

Joined: May 11th, 2007, 1:08 pm
Posts: 26
Skan wrote:
Avalon wrote:
It seems to be OK, however, I am looking something I can code. I mean this is a possible solution, but I would prefer to write something on my own - with some help of course.


Is Mr.Green H troubling you ? :D
I do not see any other advantage of having your own compiled exe.

:)


Hehe, but it's easy, I want to learn AHK, so I might write more complicated code. :)
Well, I am not saying it's all just learning cause, but the big point is to get some experience with AHK. :)

_________________
dA Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2007, 9:33 pm 
@Skan
Thanks a lot for your 3 steps post.
1) Copy Andreas Borutta's script...
2) Rename AutoHotkey.exe to HotStrings.exe...
3) Place HotStrings.exe and AutoHotkey.INI in the same folder...
Exactly what I was looking for.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2007, 9:58 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Normand Lamoureux wrote:
@Skan
Thanks a lot


I am not sure but I vaguely remember that the original idea was from my dear friend majkinetor. :)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, oldbrother and 17 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