Welcome Guest.   Make a donation to an author on the site September 16, 2014, 10:29:46 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Little modification to menuak.ahk  (Read 2188 times)
Contro
Participant
*
Posts: 2,120

View Profile Give some DonationCredits to this forum member
« on: June 05, 2012, 06:30:02 PM »

I am using the splendid program menuak.ahk

Is possible to modify ?

My problem is simple.

If I put a link in my CRM Goldmine 5.5 don't find the launcher.ini. curiosly don't happen when launched with PowerTray from lopesoft.com.

Example :
Y:\PORTABLES\Personaliza pc\menuak.ahk\menuak.ahk
When I execute don't read the launcher.ini. Reads the standard one because don't find the corresponding in the same folder.
Y:\PORTABLES\Personaliza pc\menuak.ahk\launcher.ini

I have tried to solve this problem with a bat file, but the result is not good because I don't know how to close the cmd window while I am executing the script.
So. I would like to obtain a menuak.ahk able to find the launcher.ini in the same folder where the .ahk file is.

The initial code is :

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. IniRead, numRows, launcher.ini, General, numRows, 0
  2. IniRead, numCols, launcher.ini, General, numCols, 0
  3. if !numRows
  4.  InputBox, numRows, , Enter number of rows   , , 200, 120, , , , , 5
  5. if !numCols
  6.  InputBox, numCols, , Enter number of columns, , 200, 120, , , , , 2
  7. IniWrite, %numRows%, launcher.ini, General, numRows
  8. IniWrite, %numCols%, launcher.ini, General, numCols
  9.  
  10. Loop % numRows*numCols
  11. {
  12.  IniRead, Title%A_Index%, launcher.ini, Titles, Title%A_Index%, %A_Index%
  13.  IniRead, Path%A_Index%, launcher.ini, Paths, Path%A_Index%,
  14. }
  15.  
  16. Gui, Add, Button, w150 r1.5 gRun vButt1, %Title1%
  17. Gui, Add, Button, w40 hp xp+150 gEdit vEdit1, Edit
  18. Edit1:=1
  19. Butt1:=1
  20.  
  21. Loop % numRows*numCols-1
  22. {
  23.  Index:=A_Index+1
  24.  Title:=Title%Index%
  25.  ys:=!Mod(Index-1, numRows) ? "ys" : "xp-150 yp+35"
  26.  Gui, Add, Button, w150 hp %ys% gRun vButt%Index%, %Title%
  27.  Gui, Add, Button, w40 hp xp+150 gEdit vEdit%Index%, Edit
  28.  Edit%Index%:=Index
  29.  Butt%Index%:=Index
  30. }
  31.  
  32. Gui, Show, , Menu expedientes
  33.  
  34. Gui 2:+owner
  35. Gui 2:Add, Text, right, Button title:
  36. Gui 2:Add, Text, right, Program to run:
  37. Gui 2:Add, Edit, w300 ys vSelTitle
  38. Gui 2:Add, Edit, w300 vSelPath
  39. Gui 2:Add, Button, w25 gFileSelect vFileSelect r0.9 xp+300 yp, ....
  40. Gui 2:Add, Button, w100 gSelOk r1.5 xp-250 yp+35 default, OK
  41.  
  42.  
  43.  tpp:= % "Path" %A_GuiControl%
  44.  Run % %tpp%
  45.  
  46.  Gui +Disabled
  47.  cIndex:=%A_GuiControl%
  48.  GuiControl, 2:, SelTitle, % Title%cIndex%
  49.  GuiControl, 2:, SelPath, % Path%cIndex%
  50.  FileSelect:=cIndex
  51.  Gui 2:Show, , Select options for button ?%cIndex%
  52.  
  53. FileSelect:
  54.  Gui +OwnDialogs
  55.  FileSelectFile, Path%cIndex%, 3, %A_ProgramFiles%, Select program to run with button ?%cIndex%, Programs(*.exe;*.lnk;*.bat)
  56.  GuiControl, 2:, SelPath, % Path%cIndex%
  57.  
  58.  
  59. 2GuiClose:
  60.  Gui 1:-Disabled
  61.  Gui 2:Cancel
  62.  
  63. SelOk:
  64.  Gui 1:-Disabled
  65.  Gui 2:Submit
  66.  Path%cIndex%:=SelPath
  67.  Title%cIndex%:=SelTitle
  68.  GuiControl, 1:, Butt%cIndex%, % Title%cIndex%
  69.  IniWrite, % Title%cIndex%, launcher.ini, Titles, Title%cIndex%
  70.  IniWrite, % Path%cIndex%, launcher.ini, Paths, Path%cIndex%

and the launcher.ini contains the configuration

[General]
numRows=5
numCols=2
[Titles]
Title1=Carpetas expediente
Title2=Traspaso Gestión MGD
Title3=Creación Goldmine
Title4=Procedimientos Proyecto
Title5=Procedimientos Informáticos
Title6=Procedimientos Comunes
Title7=Generar orden de trabajo
Title8=Lanzar una carpeta
Title9=Lanzar una web
Title10=Lanzar Goldmine
[Paths]
Path1=Y:\GABINETE\PROYECTOS\Listas.exe
Path2=ERROR
Path3=ERROR
Path4=ERROR
Path5=ERROR
Path6=ERROR
Path7=ERROR
Path8=Y:\PORTABLES\Educativos\BabelBox
Path9=http://www.autohotkey.com/forum/viewtopic.php?p=304050#304050
Path10=Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p:

(is a simple example, not real)

 Kiss
« Last Edit: June 05, 2012, 06:36:10 PM by Contro » Logged
skwire
Moderator
*****
Posts: 4,068



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: June 05, 2012, 07:00:03 PM »

Try adding the following line as the first line in your akmenu.ahk script file:
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SetWorkingDir, %A_ScriptDir%
Logged

highend01
Supporting Member
**
Posts: 81


View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 05, 2012, 07:02:29 PM »

Try to replace all launcher.ini occurrences with:
[copy or print]
%A_ScriptDir%\launcher.ini
Logged
kunkel321
Supporting Member
**
Posts: 387


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: June 05, 2012, 10:34:56 PM »

What is this splendid menuak?
Logged
Contro
Participant
*
Posts: 2,120

View Profile Give some DonationCredits to this forum member
« Reply #4 on: June 06, 2012, 06:17:11 PM »

Try adding the following line as the first line in your akmenu.ahk script file:
Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. SetWorkingDir, %A_ScriptDir%

Nice idea indeed. Goingggg

 Kiss
Logged
Contro
Participant
*
Posts: 2,120

View Profile Give some DonationCredits to this forum member
« Reply #5 on: June 06, 2012, 06:17:45 PM »

Try to replace all launcher.ini occurrences with:
[copy or print]
%A_ScriptDir%\launcher.ini

Nice idea. I will apply.

Best Regards
 Kiss
Logged
Contro
Participant
*
Posts: 2,120

View Profile Give some DonationCredits to this forum member
« Reply #6 on: June 06, 2012, 06:19:25 PM »

What is this splendid menuak?

Is a menu maker. You can propose webs, exe, bat, and so on. I am using a menu with 225 options. Marvellous.
Above is the code.

 smiley
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.099s | Server load: 0 ]