Posted: 03 Jul 2008 22:30
Nicely done Don - that's much better!
Will we be seeing tree/list values coming to other commands as well?
Will we be seeing tree/list values coming to other commands as well?
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
Set(%cf%,<curfolder>);
Set(%cp%,<curpath>);
Set(%nn%,<date yyyymmddhhnnss>);
OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * %nn%-temp\", "s");
Msg("Press OK when WinRAR is finished.",1);
GoTo("<curpath_s>\%nn%-temp")
Sel(a);
Rename(bat,%cf%);
Focus(L);
MoveTo("..\..");
#523;
#523;
Rename(bat,%nn%,,"%cp%");
SelFilter(%nn%, d, Name);
Focus(L);
#169;After implementing above, we can specify the name of the window and match it with the one of a running process.EnumWindows
The EnumWindows function enumerates all top-level windows on the screen by passing the handle of each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.
VB4-32,5,6
Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later
Library
User32
Parameter Information
· lpEnumFunc
Points to an application-defined callback function. For more information, see the EnumWindowsProc callback function.
· lParam
Specifies a 32-bit, application-defined value to be passed to the callback function.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Was that sarcastic? If yes then it wasn't necessary. It's important to know if check for a specific running (and not running) process can be performed, especially when external applications are being utilised to do work via a script. Being able to determine the above would help automate some scripts even more, which would make them more efficient and isn't efficiency the whole point of XYplorer?!jacky wrote:hmmm, yes, "crucial".....
"You keep using that word. I do not think it means what you think it means."ivan wrote:Was that sarcastic? If yes then it wasn't necessary. It's important to know if check for a specific running (and not running) process can be performed, especially when external applications are being utilised to do work via a script. Being able to determine the above would help automate some scripts even more, which would make them more efficient and isn't efficiency the whole point of XYplorer?!jacky wrote:hmmm, yes, "crucial".....
Yes, I do know what it means. The problem that I see is that when conceiving, how can anyone overlook the fact that there is a huge probability that external apps would be used to carry out the task and as such it should be possible to know once it's done.TheQwerty wrote:"You keep using that word. I do not think it means what you think it means."
EnumWindows would get the text of a window and if matched to set value then bingo! And if it's trivial then how do you propose process monitoring should be incorporated into XY?TheQwerty wrote:First, no it's not currently possible within XY. Second, you wouldn't want to use EnumWindows. That tells you nothing about the processes running. Third, this would be trivial to incorporate into XY with AutoHotkey or any other scripting language.
A simple Msg box after that the user clicks to say "Hey the program finished successfully!" solves this issue. Thus, it's not crucial. Would it be beneficial if XY scripting had a Run & Wait command, yes. But it is not crucial!ivan wrote:Yes, I do know what it means. The problem that I see is that when conceiving, how can anyone overlook the fact that there is a huge probability that external apps would be used to carry out the task and as such it should be possible to know once it's done.TheQwerty wrote:"You keep using that word. I do not think it means what you think it means."
Yes, it gets information about Windows - not processes! What if the executed program doesn't create a window? EnumWindows would be useless here.ivan wrote:EnumWindows would get the text of a window and if matched to set value then bingo!
Incorporated into XY was a bad choice of words on my behalf. What I meant is it would be trivial to use an external script or program to get around this "crucial" show-stopping bug. For example...ivan wrote:And if it's trivial then how do you propose process monitoring should be incorporated into XY?
In my case it adds no efficiency and hardly makes it more automated. Having not been around when scripting was first thought of, I'm struggling to understand what the concepts were. Was it first founded as a one-internal-operation kind of thing? Seems that way because making it so you can access and utilise external apps and combining scripting commands into one chunk of XYS code HAS to require the monitoring of what's going on. As of right now, displaying Msg box in which the user can confirm seems to me as an apple falling close to the tree of stepping through a script with no prompt for confirmation.TheQwerty wrote:A simple Msg box after that the user clicks to say "Hey the program finished successfully!" solves this issue. Thus, it's not crucial. Would it be beneficial if XY scripting had a Run & Wait command, yes. But it is not crucial!
In my case it does create a window (and a process) so it wouldn't be uselessTheQwerty wrote:Yes, it gets information about Windows - not processes! What if the executed program doesn't create a window? EnumWindows would be useless here.
I'm confused. You say that it's trivial to use an external script or program, but then you go ahead and use an external script that relies on an external utility. Surely that's offloading the workload onto an outside program instead of dealing with and improving things in-house.TheQwerty wrote:Incorporated into XY was a bad choice of words on my behalf. What I meant is it would be trivial to use an external script or program to get around this "crucial" show-stopping bug. For example...
In the XY script:
Do whatever you do before running the program.
Call an AHK script to execute the actual program (instead of calling the program directly).
Display a message box before completing the script.
In the AHK script:
Execute the program.
Wait for the program to finish.
Close the message box automatically.
That gets around the limitation and removes the difficulty of having the user click the message box to continue.
I never said Don shouldn't improve XY scripting, or that a Run & Wait function wouldn't be useful, just that it's trivial to write and use an external script/program called from XY to do the executing and closing of a message box.ivan wrote:I'm confused. You say that it's trivial to use an external script or program, but then you go ahead and use an external script that relies on an external utility. Surely that's offloading the workload onto an outside program instead of dealing with and improving things in-house.
I'm not asking an external program to do the executing and closing of a message box, it should all be part of scripting.TheQwerty wrote:I never said Don shouldn't improve XY scripting, or that a Run & Wait function wouldn't be useful, just that it's trivial to write and use an external script/program called from XY to do the executing and closing of a message box.
Really, my only point is that just like holding the user's hand through the tough times when they attempt to empty an empty recycle bin, this isn't crucial.
While I'll agree that crucial is a matter of opinion, I think that in the overall scheme of things FVS and the catalog are definitely crucial and that is based on 2 1/2+ yrs of history here...both features are of use to almost everyone who uses XY, while scripting is a niche feature that many users will never touch.ivan wrote:What's crucial and what isn't is a matter of opinion. Just because you don't think something is crucial doesn't render it unimportant. I personally don't think FVS is crucial and if catalogue wasn't a part of XY then I wouldn't loose a second of my sleep tonight.
And that's part of why I personally, as above, highly depend on the catalog and now FVS! Scripting is just icing on the cake, but the catalog IS the cake! It's one feature which I believe is unique to XY and thus leads to new users/sales, who can use it immediately, even if they are limited in knowledge.ivan wrote:You'd be surprised how quickly everyday tasks become crucial to some people.
I think things that you don't come to expect when you migrate over to XY from WE can't be considered crucial, so that rules out the catalogue and a heap of other things. That's not to say that they aren't great though.j_c_hallgren wrote:While I'll agree that crucial is a matter of opinion, I think that in the overall scheme of things FVS and the catalog are definitely crucial and that is based on 2 1/2+ yrs of history here...both features are of use to almost everyone who uses XY, while scripting is a niche feature that many users will never touch.
I don't depend on the catalogue or FVS, but that's me and we're all different. For me scripting+UDC are the cake and FVS is the icing. Making something unique to XY doesn't necessarily lead to improvement is users/sales.ivan wrote:And that's part of why I personally, as above, highly depend on the catalog and now FVS! Scripting is just icing on the cake, but the catalog IS the cake! It's one feature which I believe is unique to XY and thus leads to new users/sales, who can use it immediately, even if they are limited in knowledge.
It appears that we disagree on this, which is fine, but think of the overall/entire user base to determine how valuable a new feature may be.
Yes, I've said that...but that also doesn't discount that when a feature continues to keep getting asked for over time by new users, it makes business sense to work on those first and then add other lesser requested features as time allows...so I'm not saying that majority should rule on features, but they certainly can influence the importance of which ones are added and in what order.ivan wrote:For someone who I remember saying (correct me if I'm wrong!) that it's the sheer amount of customization that can be done to XY to suit user's needs is the beauty of XYplorer, I'm surprised to read that you think that the majority should rule on the value of a potential new feature.
Same can thus be said for scripting and UDC, right?ivan wrote:I think things that you don't come to expect when you migrate over to XY from WE can't be considered crucial, so that rules out the catalogue and a heap of other things. That's not to say that they aren't great though.