 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
dwjp90
Joined: 20 Jul 2009 Posts: 36
|
Posted: Wed Nov 18, 2009 9:02 am Post subject: internal program not running |
|
|
i have my ahk script fire a program with parameters.
in the script qpeditor it will not work
but if used in a standalone script it works fine
but if used with a standalone script that will pass the parameters to it doesnt work and idk why
here the code with all the exes and sub files
http://www.megaupload.com/?d=CLHYOQ5Y
and here is just the script (prob around line 166)
QP editor.ahk
| Code: | /*
* * * Compile_AHK SETTINGS BEGIN * * *
[AHK2EXE]
Exe_File=%In_Dir%\QP editor.exe
[VERSION]
Set_Version_Info=1
File_Version=2.5.1.5
Inc_File_Version=1
Product_Version=1.0.48.5
Set_AHK_Version=1
[ICONS]
Icon_1=%In_Dir%\QPconfig.ico
* * * Compile_AHK SETTINGS END * * *
*/
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Singleinstance, force
GUI, add, text,, Drag and Drop a file onto the area`nThen Click the create button below the box`nTo create a new control
gui,add, Edit, readonly vleft r5 x10 y50 w90 -HScroll -VScroll, Drop Here to Edit`nQP Circle`nLeft Touch Button`n`n
gui,add, Edit, readonly vright r5 x110 y50 w90 -HScroll -VScroll,Drop Here to Edit`n QP dvd`nRight Touch Button`n`n
Gui,add,Button,x10 y150 glc,Create
Gui,add,Button,x60 y150 glcc,clear
Gui,add,Button,x110 y150 grc,Create
Gui,add,Button,x160 y150 grcc,clear
Gui,add,Button,x20 y190 gbc,Create Both
Gui,add,Button,x120 y190 gbcc,Clear Both
Gui,add,Button,x20 y230 default,Done
Gui,add,Button,x120 y230,Cancel
gui, show
nada:
;nada
return
GuiDropFiles:
gui,submit,nohide
If (A_GuiControl = "left")
{
qpc=%A_GuiEvent%
Splitpath,A_GuiEvent,,,exts ;checks if the drop is a shortcut, so arguments apply to the lauch
If (exts:="lnk")
{
FileGetShortcut,%A_GuiEvent%,icogetq,,argsc
}
}
Else If (A_GuiControl = "right")
{
qpdvd=%A_GuiEvent%
Splitpath,A_GuiEvent,,,extd ;checks if the drop is a shortcut, so arguments apply to the lauch
If (extd:="lnk")
{
FileGetShortcut,%A_GuiEvent%,icogetd,,argsd
}
}
Else
{
msgbox,You missed`, try again ;so gui drops font happen in blank
}
return
lc:
gui,submit,nohide
If (qpc <> "") ;checks if the varible is blank
{
If (argsc <> "") ;checks for aruments
{
gosub,icoqp ;extracts the icons from the droped file
gosub,icondel ;deletes the excess icons created above
Run makeshrtcut.exe "%qpc%" "nada" "%argsc%" ;creats the shortcut with aruments
}
Else
{
gosub,icoqp ;extracts the icons from the droped file
gosub,icondel ;deletes the excess icons created above
Run makeshrtcut.exe "%qpc%" "nada" ;creates a shortcut without arguments
}
}
Else
{
msgbox, No File Chosen`, Please drop a file onto the box ;stops you from deleting the shortcuts, or making blank ones
}
return
lcc:
gui,submit,nohide
qpc:="" ;resets the variable
return
rc:
gui,submit,nohide
If (qpdvd <>"") ;checks if the varible is blank
{
If (argsd <> "") ;checks for arguments
{
gosub,icodvd ;creats icons for the droped file
gosub,icondel ;delests excess icons that were created above
Run makeshrtcut.exe "nada" "%qpdvd%" "" "%argsd%" ;makes shortcut with arguments
}
Else
{
gosub,icodvd ;creats icons for the droped file
gosub,icondel ;delests excess icons that were created above
Run makeshrtcut.exe "nada" "%qpdvd%" "" ;creats shortcut without args
}
}
Else
{
msgbox, No File Chosen`, Please drop a file onto the box
}
return
rcc:
gui,submit,nohide
qpdvd:="" ;clears the var
return
bc:
If ((qpdvd <>"")&&(qpc <> "")) ;checks to makesure that both vars are not empty
{
gosub,icodvd ;extracts icons
gosub,icoqp ;extract icons
gosub,icondel ;deletes excess icons
Run makeshrtcut.exe "%qpc%" "%qpdvd%" "%argsc%" "%argsd%" ;creats shortcuts for both with arguments
}
Else
{
msgbox, No Files Chosen`, Please drop a file onto the appropriate box
}
return
bcc:
{
gui,submit,nohide
qpdvd:="" ;clears both the vars
qpc:=""
}
return
icoqp:
FileDelete,qpc.ico ;deletes it so the program dosent find it
If (exts:="lnk")
{
Run "%A_ScriptDir%\iconsext.exe" /save "%icogetq%" "%A_ScriptDir%" -icons,,Hide ;not working supposed to extract icons
}
Else
{
Run "%A_ScriptDir%\iconsext.exe" /save "%qpc%" "%A_ScriptDir%" -icons,,Hide ;not working supposed to extract icons
}
loop,*.ico,
{
if (A_LoopFileName="qpdvd.ico")
{
continue
}
Else if (A_LoopFileName="QPconfig.ico")
{
continue
}
Else
{
FileMove,%A_LoopFileName%,qpc.ico ;renames the file
break
}
}
return
icodvd:
FileDelete,dvdp.ico
If (exts:="lnk")
{
Run "iconsext.exe" /save "%icogetd%" "%A_ScriptDir%" -icons,, Hide ;not running, supposed to extract the icons
}
Else
{
Run "iconsext.exe" /save "%qpdvd%" "%A_ScriptDir%" -icons,, Hide ;not running, supposed to extract icons
}
loop,*.ico,
{
if (A_LoopFileName="qpc.ico")
{
continue
}
Else if (A_LoopFileName="QPconfig.ico")
{
continue
}
Else
{
FileMove,%A_LoopFileName%, dvdp.ico ;renames the file
break
}
}
return
icondel:
loop,*.ico,
{
if (A_LoopFileName="qpc.ico")
{
continue
}
Else If (A_LoopFileName="dvd.ico")
{
Continue
}
Else if (A_LoopFileName="QPconfig.ico")
{
continue
}
Else
{
FileDelete,%A_LoopFileName% ;removes all the excess icons created
}
}
return
ButtonDone:
ButtonCancel:
GuiEscape:
GuiClose:
exitapp
return
|
|
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 9:27 am Post subject: |
|
|
| Code: | | Run "%A_ScriptDir%\iconsext.exe" /save "%icogetq%" "%A_ScriptDir%" -icons,,Hide ;not working supposed to extract icons |
Maybe Run sees "%var%" as literal --> %var% <-- and not --> "(contents of var)" <--
You could try
| Code: | param1 = "%A_ScriptDir%\iconsext.exe"
param2 = "%icogetq%"
param3 = "%A_ScriptDir%"
Run %param1% /save %param2% %param3% -icons,,Hide |
|
|
| Back to top |
|
 |
dwjp90
Joined: 20 Jul 2009 Posts: 36
|
Posted: Wed Nov 18, 2009 9:32 am Post subject: |
|
|
no it sees it as te contents (the ""s are for the exe to see them as parameters)
i tried that and it still doesnt work |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 9:42 am Post subject: |
|
|
| a_h_k wrote: | | Maybe Run sees "%var%" as literal --> %var% <-- and not --> "(contents of var)" | Second thoughts, it should handle %% within strings (& it works for your shortcut-creating Run's, & it works in standalone script)
Another idea..
| Code: | | Run, "%A_ScriptDir%\iconsext.exe" /save "%icogetq%" "%A_ScriptDir%" -icons,,Hide | (the "correct" syntax .. since there's further comma's it might be "stuffing-up" this particular Run instance .. you should probably put that comma in all your Run commands, in case you need to add more params later) |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 9:49 am Post subject: |
|
|
| dwjp90 wrote: |
no it sees it as te contents (the ""s are for the exe to see them as parameters) |
Yes, that's why i left the ""s in the paramN variables
Last edited by a_h_k on Wed Nov 18, 2009 9:51 am; edited 1 time in total |
|
| Back to top |
|
 |
dwjp90
Joined: 20 Jul 2009 Posts: 36
|
Posted: Wed Nov 18, 2009 9:50 am Post subject: |
|
|
| yea i understood that.... it wont even launch the program without params |
|
| Back to top |
|
 |
dwjp90
Joined: 20 Jul 2009 Posts: 36
|
Posted: Wed Nov 18, 2009 9:53 am Post subject: |
|
|
ok it enters the gosub, but the run commands arn't doing anything
run notepad doesnt even work |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 10:00 am Post subject: |
|
|
| I might have to try it for myself... |
|
| Back to top |
|
 |
dwjp90
Joined: 20 Jul 2009 Posts: 36
|
Posted: Wed Nov 18, 2009 10:02 am Post subject: |
|
|
GOT IT!!!!
i was using := in my if statements and that messed it up.
you made me find my error thank you |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Wed Nov 18, 2009 10:21 am Post subject: |
|
|
I had no idea those were hiding in there!  |
|
| 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
|