Page 2 of 2

Re: Run scripts from an external program?

Posted: 25 Oct 2012 19:49
by Filehero
admin wrote:If I survive this, ...
Stop scaring me!

<ot>Once you finished this 200k-line challenge, you may want to drop some - or more - words on your approach to that tremendous refactoring along the release news. I'm very, very curios :wink: </ot>


Keep on going,
Filehero

Re: Run scripts from an external program?

Posted: 25 Oct 2012 19:58
by admin
Filehero wrote:
admin wrote:If I survive this, ...
Stop scaring me!

<ot>Once you finished this 200k-line challenge, you may want to drop some - or more - words on your approach to that tremendous refactoring along the release news. I'm very, very curios :wink: </ot>
When you see the LNG template you will get it.

Something like this:

Code: Select all

1234="<#> source <item;~s> in <$p>::::<#> <Quellobjekt;~e> in <$p>"

Code: Select all

1234="<#> source <item;~s> in <$p>====<#> <Quellobjekt;~e> in <$p>"
Not sure yet about the best separator (::::, ====) between English and the translation. Should be unique and visually nice and easily producible on any keyboard. (I found that my forst idea ">>" does not work so good with my variables <$v>.)

Re: Run scripts from an external program?

Posted: 25 Oct 2012 20:28
by Filehero

Code: Select all

1234="<#> source <item;~s> in <$p>++++<#> <Quellobjekt;~e> in <$p>"

Code: Select all

1234="<#> source <item;~s> in <$p>****<#> <Quellobjekt;~e> in <$p>"
I prefer the num pad for tedious stuff.

Back to <ot>: I rather meant
- how did you assure all hard-coded locations are hit?
- what basic design changes to the core classes/framework you finally have decided to apply?
- what regressions do you use during transformation? I mean - especially with the SC engine in mind - how do you assure harmful functional side-effects are excluded by feasible means?

To much OT I'm afraid....back to preparation for Win 8.


Greetz,
Filehero

Re: Run scripts from an external program?

Posted: 25 Oct 2012 20:53
by admin
I give you the phases:

1. prepare the source code for machine processing (many weeks, no fun)
2. write source code processing routine (3 hours, fun)
3. run source code processing routine (3 seconds, big fun)

It has the nice twist that XY will harvest English language strings from its own source code files. :)

Re: Run scripts from an external program?

Posted: 25 Oct 2012 21:17
by Filehero
admin wrote:It has the nice twist that XY will harvest English language strings from its own source code files. :)
Damn, that's sustainable IT in practice! :mrgreen:

I will come back to 1. some day (that's what I'm after, I like this kind of puzzles... :wink: ).


Thanks,
Filehero

Re: Run scripts from an external program?

Posted: 26 Oct 2012 14:43
by printedtopsntees
kodyman wrote:
Channing wrote:
highend wrote:So we'll see a working Listary integration (in XYplorer) soon?
Yes, very soon :D
YEA!!! :biggrin: :appl:

Listary is an incredibly useful add on and everyone I download it for loves it, so many thanks Channing.

I use the free version at the moment as this does everything I want because the free version is so capable and the "extras" in the paid for version are not compelling, but if a version linked in to XYP was paid for I'd get it in a flash.

At the moment the difference between the Free and Paid for versions is too small and the extras are very specific. So, Channing, give us a good reason to upgrade as I think it's important to support the small software developers.

Re: Run scripts from an external program?

Posted: 29 Oct 2012 09:09
by admin
Hi Channing,

the next BETA will have this:

Code: Select all

    + DEVELOPERS: Now you can run an XYplorer script from an external 
      program using the WM_COPYDATA command with XYplorer's hWnd. 
      - cds.dwData: 4194305 (0x00400001)
      - cds.lpData: 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 ::).
      Note that this feature is not available in the Home Edition 
      (because it does not support scripting).
When? Well, I still need a couple of days to finish that language thing.

There is a small issue yet: What if the user has enabled "Step Mode" (showing a sort of debug window for triggering a script manually command by command)? Hmmm...

Don

Re: Run scripts from an external program?

Posted: 29 Oct 2012 09:48
by PeterH
admin wrote:There is a small issue yet: What if the user has enabled "Step Mode" (showing a sort of debug window for triggering a script manually command by command)? Hmmm...

Don
From my point of view the ability to debug should be here, too.

But maybe it could be possible, even in Step Mode, to check the script for an Unstep as very first command, and then execute it even if Step Mode is active?

But I think whatever you will do will have some disadvantage in special situations.

Re: Run scripts from an external program?

Posted: 29 Oct 2012 10:39
by Marco
I would think of an option like "Allow external programs to run unstepped scripts", with an explanation in the Help like "This option overrides Scripting - Step Mode for said scripts".

Re: Run scripts from an external program?

Posted: 29 Oct 2012 11:51
by eil
Marco wrote:I would think of an option like "Allow external programs to run unstepped scripts", with an explanation in the Help like "This option overrides Scripting - Step Mode for said scripts".
good solution. :)

Re: Run scripts from an external program?

Posted: 29 Oct 2012 15:33
by Channing
Hello Don,

Thank you for the update!
admin wrote:There is a small issue yet: What if the user has enabled "Step Mode" (showing a sort of debug window for triggering a script manually command by command)? Hmmm...
Doesn't sounds like a big problem. In my understanding "Step Mode" will only be enabled temporarily for debugging purposes. But it may still be a little weird for the uses to see some unexpected scripts keep coming :eh:

Re: Run scripts from an external program?

Posted: 15 Apr 2013 18:30
by admin
Channing wrote:
admin wrote:If you tell me what exactly you want to achieve by remote scripting, I might find an easier and safer way for you to do it.
Here are a few things I need currently:
  • Get the selected/highlighted file path in the current XYplorer instance. Then with one simple hot key press, Listary can help the user open it in a file dialog.
  • Let the current XYplorer window jump to a folder and select one specific file. The new beta version of Listary adds Everything integration, and I'd like to bring the ultra fast full disk search experience to XYplorer.
  • Export the file list content. This will make it easier for Listary to do some search and add favorites.
  • Open a new tab with specific path and file type filters. With Listary you can use Total Commander to totally replace file dialogs, and I'd love this feature to also support XYplorer.
Also, I'd like to confirm the WM_COPYDATA runs synchronously, i.e. at the moment WM_COPYDATA returns, the script is guaranteed to be finished?

Thank you very much for your time :)
Hi Channing,

there are some recent advances in inter-process communication you might like to know of. Especially this might be interesting:

Code: Select all

v12.30.0104 - 2013-04-15 10:24
    + SC CopyData enhanced: Added a mode (previously "flags") to 
      immediately return the text, with variables resolved, to the sender.
      Syntax: copydata hwnd, data, mode
        mode:
            2: Resolve variables in data and return to sender immediately.
               Variables are XYplorer native and environment variables.
      Example:
        - Determine <curitem> in another XYplorer instance (hWnd 197078):
          copydata 197078, '<curitem>', 2; echo <get copieddata 3>;
        Note that the single quotes in the example are essential else 
        <curitem> would be resolved in *this* instance of XYplorer 
        before being sent to the other instance.
    > Note for DEVELOPERS:
      The mode parameter in SC CopyData simply select different dwData
      - If called with mode 0 then
          cds.dwData == 4194304 (0x00400000)
          = Do nothing special.
      - If called with mode 1 then
          cds.dwData == 4194305 (0x00400001)
          = Data is XYplorer script; execute this script immediately.
      - If called with mode 2 then
          cds.dwData == 4194306 (0x00400002)
          = Resolve variables in data and return to sender immediately.
      So any application can use these dwData values to trigger a 
      specific reaction in XYplorer when it receives data via 
      WM_COPYDATA.
So, sending data via WM_COPYDATA to XYplorer with cds.dwData == 4194306 (0x00400002) will result in an immediate reply from XYplorer with all variables in data resolved.