Fileversion
Posted: 05 Jun 2009 23:21
Is there a way to get the fileversion of a .dll in a column? I can see it in the /info/ window, but I was hoping not to click on every file to check.
Thanks.
Thanks.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Hi and Welcome to XYplorer,timhatz wrote:Is there a way to get the fileversion of a .dll in a column? I can see it in the /info/ window, but I was hoping not to click on every file to check.
Thanks.
It would be a clever way to use commentsserendipity wrote:Hard: You can run a script once which will show all file versions of you dlls in comments column. If you need that script let me know.
EDIT: I was curious and wrote it anyway, copy the below script and paste it to catalog (Right-click on catalog, Add new item here, Next to location field click on edit and paste the code) and go to folder where you have dlls and click on this new item you created. You should see the file versions in the comments column (right-click on the column "Name" header and enable "Comments").ale wrote:It would be a clever way to use commentsserendipity wrote:Hard: You can run a script once which will show all file versions of you dlls in comments column. If you need that script let me know.I'm not interested in the actual script but may I ask how would you proceed to get file info informations? parsing a generated report, let's say to clipboard, and then populating comments? is there a more direct way?
Code: Select all
//Set global value
global $itemscount;
//filter dll files
filter ".dll";
//getinfo of number of items in list
$itemscount= getinfo ("countitems");
focus;
//select item 1
sel 1;
//goto subscript "_comment"
sub "_comment";
//subscript comment
"_comment"
//declare global value
global $itemscount;
//getinfo of item position
$itempos = getinfo ("focusedpos");
//compare position number and total file number
IF ($itempos == $itemscount) {
//goto subscript "_end"
sub "_end";
}
ELSE {
//write file version of file to comments column
comment <curver>;
//select next file
sel +1;
//goto subscript "_comment"
sub "_comment";
}
"_end"
//remove filter
filter;
//show status "Done"
status "Done";
Code: Select all
global $itemscount;
$itemscount= getinfo ("countitems");
if ($itemscount <= 0) {
status "No files to process.";
end true;
}
focus;
sel 1;
$rowcounter = 1;
while($rowcounter <= $itemscount) {
comment <curver>;
sel +1;
$rowcounter = $rowcounter+1;
}
status "Done";
end true;
Hi Tim,timhatz wrote:Serendipity,
I modified your great script, and came up with this, for my needs. Since this was my 1st attempt at a script (even though i stole it from you) are there any glaring issues?
A few questions, when I cut and pasted your script, I had issues, with the // comments. Once I removed them all, the script worked. Also, are there any spaces required in a script from the beginning of a line?
Thanks, Tim
Code: Select all
global $itemscount; $itemscount= getinfo ("countitems"); if ($itemscount <= 0) { status "No files to process."; end true; } focus; sel 1; $rowcounter = 1; while($rowcounter <= $itemscount) { comment <curver>; sel +1; $rowcounter = $rowcounter+1; } status "Done"; end true;
Yes, we all know that. It has "historical" reasons and comes from the time when scripting was mainly used for defining custom made menus. Since many multi-line scripts can sit in one file indenting is used as a means to identify the individual scripts (that usually correspond to a menu item).serendipity wrote:... any script line should start with a space, else the script wont work...
...yeah, like adding user-functions and then each menu could be associated with a function or somethingadmin wrote:I don't like this anymore!I don't have a head for this right now but in the long run this "any script line should start with a space" thing should be replaced by something better.
Code: Select all
"Some menuitem..." nameOfScript {
foo;
echo "no spaces and I don't care!!";
$i = answer('life, everything...');
}
function answer($question) {
// this one is "hidden" as in as no menuitem associated with it...
return 42;
}Code: Select all
"Menu item : nameHere" { something; }Yep, looking good. I made a note on my Scripting 4.0 list.jacky wrote:...yeah, like adding user-functions and then each menu could be associated with a function or somethingadmin wrote:I don't like this anymore!I don't have a head for this right now but in the long run this "any script line should start with a space" thing should be replaced by something better.
Alright, so I guess technically adding brackets is all it takes..Code: Select all
"Some menuitem..." nameOfScript { foo; echo "no spaces and I don't care!!"; $i = answer('life, everything...'); } function answer($question) { // this one is "hidden" as in as no menuitem associated with it... return 42; }..but isn't it more fun with user-functions?Code: Select all
"Menu item : nameHere" { something; }![]()
You can get rid of "global $itemscount;" because its needed only if you use subscripts in your script like i did in the original script.timhatz wrote: are there any glaring issues?Code: Select all
global $itemscount; $itemscount= getinfo ("countitems"); if ($itemscount <= 0) { status "No files to process."; end true; } focus; sel 1; $rowcounter = 1; while($rowcounter <= $itemscount) { comment <curver>; sel +1; $rowcounter = $rowcounter+1; } status "Done"; end true;