AutoHotkey Community

It is currently May 27th, 2012, 4:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: February 26th, 2010, 7:18 pm 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
if i have a compiled script that is running with the #singleinstance ignore directive, how can i pass parameters to the script as described here?
http://www.autohotkey.com/docs/Scripts.htm#cmd

Is this even possible?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 8:32 pm 
What kind of parameters are you passing? How are you trying to pass them to your script.exe? Can you show your code {or the relevant part}?

I made an EXE which replaces text {it goes a bit further than AHK's "native" replace}. I use "Win+Space" as the trigger then input the "code letters" which tell my program what to put {from an INI file}. You can use:
Hotkey, KeyName, Label, Options
...for your trigger. And something like this {directly from my replacer script}:
Code:
do_Replace:
  Input, outKeys, V,, %HS_List%

  If outKeys <> xx
    {
      outLen := StrLen(outKeys)

      Loop, %outLen%
        SendEvent, {BS}

      If outKeys = dt
        {
          FormatTime, b_Date, YYYYMMDDHH24MISS, %DtForm%
          tmpRepSt := %b_Date%
          SendInput, %b_Date%
        }
      Else
        {
          tmpRepSt := varRepSt_%outKeys%
          IfInString, tmpRepSt, `%clip`%
            StringReplace, tmpRepSt, tmpRepSt, `%clip`%, %Clipboard%, A

          StringReplace, tmpRepSt, tmpRepSt, ~~, `n, A
          SendInput, {Raw} %tmpRepSt%
        }
    }

Return


Other than removing that "#SingleInstance Ignore" that's about all I can think of. But it all depends on the purpose of your script, AFAIK.

DBM


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 8:41 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Perhaps
http://www.autohotkey.com/docs/commands/OnMessage.htm
IPC http://www.autohotkey.com/forum/topic21699.html
reload with parameters http://www.autohotkey.com/forum/viewtop ... 240#268240
:?:

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 9:58 pm 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
Thanks guys for the suggestions.

I am going to set up a right click context menu within explorer that will send the following to my script when a certain file is right clicked:

Code:
c:\myapp.exe %1


%1 being the file that is right clicked.

The script will use this file.

As my app takes too much time to load, so reloading is not an option. I really don't want to create a second exe that will receive the cmd params and then pass to my main app. This is very undesirable.

With all that being said, anyone have any ideas?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:07 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
But that is easy to solve. Why use the context menu? No need! Simply use a hotkey in your script that will send ^c which will get the filepath from explorer into the clipboard and take it from there.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:11 am 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
Thanks Hugov~

I already have a massive amount of hotkeys and one included to do just that, but i thought it would be easier for my users to have a context menu item in place as well.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:12 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
drag & drop file(s) ?

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:13 am 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
lol got that too!
:)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Mickers, rbrtryn and 66 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