XYplorer Messenger - Rev. 1.20 / 2013/02/08

Discuss and share scripts and script files...
serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by serendipity »

serendipity wrote:.... I was successful in using /script switch though, but no big deal the above syntax works already.
Sorry, i meant I was not successful in using /script switch with XYplorer Messenger.

klownboy
Posts: 4136
Joined: 28 Feb 2012 19:27

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by klownboy »

Thanks Marco. It's actually quite responsive (i.e., using xyplorer_messenger.exe) to run a script from a Windows Shortcut. Could anything "simple" be done to start XY if it isn't running already or is that beyond the initial scope or reason for the program as you explained earlier?
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

serendipity wrote:
serendipity wrote:.... I was successful in using /script switch though, but no big deal the above syntax works already.
Sorry, i meant I was not successful in using /script switch with XYplorer Messenger.
Because that's not how it is supposed to work. Read the first post where I quote XY pdf help file.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

klownboy wrote:Thanks Marco. It's actually quite responsive (i.e., using xyplorer_messenger.exe) to run a script from a Windows Shortcut. Could anything "simple" be done to start XY if it isn't running already or is that beyond the initial scope or reason for the program as you explained earlier?
Ken
Mmh, it would be conceptually simple, but I'm not an autoit guru...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

klownboy
Posts: 4136
Joined: 28 Feb 2012 19:27

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by klownboy »

Hey Marco,
I'll have to play around and test it using AHK. I'm getting rusty (maybe binocular222 could help), but I imagine (in AHK) something like:

Code: Select all

  If ! ( HWND := WinExist("ahk_class ThunderRT6FormDC") )
	   {Run, D:\Tools\XYplorer\XYplorer}
in binocular's AHK code.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by serendipity »

Marco wrote:
serendipity wrote:
serendipity wrote:.... I was successful in using /script switch though, but no big deal the above syntax works already.
Sorry, i meant I was not successful in using /script switch with XYplorer Messenger.
Because that's not how it is supposed to work. Read the first post where I quote XY pdf help file.
Oh sorry, i completely misunderstood your first post then. I was misled by the word identical here:

Code: Select all

The syntax is identical to the one of the command line switch /script=<script resource>, so you can either pass the path to a script file (commonly called *.xys), or pass the script directly (must be preceded by ::).
Suggestion: maybe change that part and provide actual working syntax, like:

Code: Select all

pathtoxyplorer_messenger.exe ::load "scriptname.xys"
Thanks.

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

serendipity wrote: Suggestion: maybe change that part and provide actual working syntax, like:

Code: Select all

pathtoxyplorer_messenger.exe ::load "scriptname.xys"
Thanks.
Look better under Usage :wink: :mrgreen:
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by serendipity »

Marco wrote:
serendipity wrote: Suggestion: maybe change that part and provide actual working syntax, like:

Code: Select all

pathtoxyplorer_messenger.exe ::load "scriptname.xys"
Thanks.
Look better under Usage :wink: :mrgreen:
Lol, Blame it on Saturday. And the snow here. I am out to play now. :mrgreen:

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

This code send command line parameter to XYplorer.exe. If XYplorer.exe isn't currently running, then run it and wait for the program to start then send the command line.

Code: Select all

#notrayicon
MessagetoXYplorer = %1%

SetTitleMatchMode, 2
Ifwinexist XYplorer ahk_class ThunderRT6FormDC
SendFunction(MessagetoXYplorer)
Else
{
Run E:\7Utilities\XYplorer\XYplorer.exe
winwait, XYplorer ahk_class ThunderRT6FormDC
SendFunction(MessagetoXYplorer)
return
}

SendFunction(MessagetoXYplorer)
{
HWND := WinExist("XYplorer ahk_class ThunderRT6FormDC")
Size := StrLen(MessagetoXYplorer)
If !(A_IsUnicode) {
   VarSetCapacity(Data, Size * 2, 0)
   StrPut(MessagetoXYplorer, &Data, "UTF-16")
} Else {
   Data := MessagetoXYplorer
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(4194305, COPYDATA, 0, "Ptr")
NumPut(Size * 2, COPYDATA, A_PtrSize, "UInt")
NumPut(&Data, COPYDATA, A_PtrSize * 2, "Ptr")
Result := DllCall("User32.dll\SendMessageW", "Ptr", HWND, "UInt", 74, "Ptr", 0, "Ptr", &COPYDATA, "Ptr")
}
Note:
+ No tray icon is displayed, thus no glitch in tray bar
+ Replace %1% in the second line to any command you want (%1% stand for the command-line you pass to the script)
+ A little modification allow passing multiple parameters, but I feel it's superfluous
+ It's possible to make XYplorer window invisible (XYplorer.exe will run in background and execute the command)
+ Modify this line "Run E:\7Utilities\XYplorer\XYplorer.exe", save as ".ahk" then use the attached complier (ow download complier from Autohotkey website)
Attachments
Compiler.zip
AHK complier
(2 MiB) Downloaded 166 times
Last edited by binocular222 on 10 Feb 2013 03:22, edited 1 time in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

btw, this AHK code constantly running in the background and send message to XYplorer every 0.5 sec. It's very useful for renaming tabs (see my signature)

Code: Select all

#notrayicon
#Persistent
Settimer, RenameXYplorer, 500
return
RenameXYplorer:
SetTitleMatchMode, 2
Ifwinactive XYplorer ahk_class ThunderRT6FormDC
{
MessagetoXYplorer := "::load Rename2"
HWND := WinExist("XYplorer ahk_class ThunderRT6FormDC")
Size := StrLen(MessagetoXYplorer)
If !(A_IsUnicode) {
   VarSetCapacity(Data, Size * 2, 0)
   StrPut(MessagetoXYplorer, &Data, "UTF-16")
} Else {
   Data := MessagetoXYplorer
}
VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
NumPut(4194305, COPYDATA, 0, "Ptr")
NumPut(Size * 2, COPYDATA, A_PtrSize, "UInt")
NumPut(&Data, COPYDATA, A_PtrSize * 2, "Ptr")
Result := DllCall("User32.dll\SendMessageW", "Ptr", HWND, "UInt", 74, "Ptr", 0, "Ptr", &COPYDATA, "Ptr")
}
Note: You can modify these lines:
MessagetoXYplorer := "::load Rename2"
Settimer, RenameXYplorer, 500
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

klownboy
Posts: 4136
Joined: 28 Feb 2012 19:27

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by klownboy »

Thanks Binocular222,
To test I set up a few Windows shortcuts using your modified version and ran them with and without XYplorer running. It worked fine. Since I use AHK_L, I didn't bother to compile. I passed the script(s) as a command line parameter to xyplorer_messenger.ahk. Not sure if I'd gain some speed compiling it...maybe a little. I noticed the hour glass is running for awhile when my script menu displays, but it doesn't seem to slow down menu operation (ie., the menu items function/respond even when I click on a menu item with the hour glass running).

Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by binocular222 »

I made a separate thread for XYplorer Messenger using AHK language here http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=9233
Please post any request / bug fix there.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Dario »

I use Marco's XYplorer Messenger for my purpose. I recently discovered this:
As usually, I use XYplorer Messenger shortcut with this code for Recent Location

Code: Select all

::#539;
It's work. I ignored glitch, few seconds hour glass near the cursor. And I accidentally discovered, if I put below code to XYplorer Messenger shortcut, there is no glitch.

Code: Select all

::focus A; Sendkeys "^a"; Sendkeys "::#539;"; Sendkeys "{ENTER}";
This run same script through Address bar ( Address bar should be visible, not hidden, and IMPORTANT is that Xyplorer MUST be in focus. Run this XYplorer Messenger shortcuts with double click. ).
What is explanation for this behavior?

klownboy
Posts: 4136
Joined: 28 Feb 2012 19:27

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by klownboy »

Hi Dario,
That hourglass behavior is something I've noticed when using XYplorer with the/flg=2 as well. Plug the following lines separately in to the AB and note the difference.The first one will give you an hourglass for a few seconds though it doesn't appear to affect or slowdown the operation when you are using more advanced scripts like menus.

Code: Select all

::run "<xy> /script=""::msg 'Hello there!';"" /flg=2", , 0,0;
The second script will perform the script without the annoying hourglass. It's running XY through cmd /c.

Code: Select all

::run "cmd /c <xy> /script=""::msg 'Hello there!';"" /flg=2", , 0,0;
Take a look at this thread http://www.xyplorer.com/xyfc/viewtopic. ... =45#p94029. I mention it only because I've seen the behavior experimenting with the send_message AHK script sometimes as well. Very odd especially the above which doesn't involve AHK/AutoIt messenger.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: XYplorer Messenger - Rev. 1.20 / 2013/02/08

Post by Marco »

Dario wrote:...
What is explanation for this behavior?
I have no idea :(
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply