admin wrote:Uhm. Sorry for my lack of imagination, but I don't get it. Please give an examplethat shows the necessity of those new variables.
Well, any script that doesn't end using a command that relates to all selected items, but needs to deal with them individually. I'm not saying I know every possible use for this, but I feel I can think of a few...
- a script "::load <pfaitem>" to load the script, one might assume on 2 script files, you'd want each of them to be loaded, not the same one (twice)
- a script so that one dbl-click on files on a given location, they're not opened but copied to another location. That could work with copyto, but then requires that all files are on the same location and that the destination doesn't depend on the file name itself, but just its location
- a script that would "analyzes" the file path/name and add info related to that to the clipboard, creating a "template" for what needs to be done next
- a script that would allow you to dbl-click on a local file, its path/name would be "analyzed" and then another file would be opened. So you dbl-click on some local file, and automatically it's the file you want that's somewhere on the network that is being opened, or copied into current location and then opened...
That's what I can think of now, but I'm sure there are many more use for this, where you'd need the script to deal with items individually. In fact, I've even sometimes worked on script (not PFA related) where I have wished I had a way to go through each of the selected items one by one and do whatever it is I needed to do with them, because sometimes you can't just deal with all of them at once the same way (imagine a script that would rename each selected file, incrementing part of their filename. So that "foobar 14.txt" becomes "foobar 15.txt", or that doesn't rename the same way depending on the file's current name. Of course, the later would be better anyway when conditions & loops will be supported but...)
admin wrote:<curitem>: the current item is the one that's displayed in the statusbar and the info panel. This is mostly, but not always (as in your case), identical to the one focused and selected!
Yeah, well, that makes it weird because it would make sense to say current item = selected & focused, and most of the times that's what it is. Yet, sometimes, we have a file both selected & focused, but it's somehow not the current item. And some other times, we have no selection, yet there is a file as current item ! And I'm not sure there's a logic to it (I mean, one that can be (easily) understood and dealt with from a user POV)...