Fileversion
-
timhatz
- Posts: 41
- Joined: 12 Dec 2008 06:21
Fileversion
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.
-
ale
- Posts: 127
- Joined: 19 Feb 2009 23:23
- Location: Italy
Re: Fileversion
Hello, to the best of my knowledge it cannot be done at the moment. This topic: viewtopic.php?f=3&t=3654 may also apply to your question.
You might use the report feature in info panel to create a report that also includes file version informations. The wiki has a extensive description of the report feature.
You might use the report feature in info panel to create a report that also includes file version informations. The wiki has a extensive description of the report feature.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Fileversion
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.
There are two ways to see that info, the easy way will show file version instantly but not in the column and the hard way will show file version in a column called "Comment":
Easy: You should be able to see that info in info tips when you hover the mouse over file name.
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.
Last edited by serendipity on 06 Jun 2009 00:33, edited 4 times in total.
-
ale
- Posts: 127
- Joined: 19 Feb 2009 23:23
- Location: Italy
Re: Fileversion
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.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Fileversion
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";
Last edited by serendipity on 16 Jun 2009 15:14, edited 1 time in total.
-
ale
- Posts: 127
- Joined: 19 Feb 2009 23:23
- Location: Italy
Re: Fileversion
Ok thank you a lot, I didn't happen to know <curver>, that was the key 
I don't have many scripts at the moment and I planned to rewrite them all using the new if and while constructs.
I don't have many scripts at the moment and I planned to rewrite them all using the new if and while constructs.
-
timhatz
- Posts: 41
- Joined: 12 Dec 2008 06:21
Re: Fileversion
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
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;
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Fileversion
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! any script line should start with a space, else the script wont work, but comments is not a problem.
The problem was with the line #9 in my script (sel 1;) which did not have a space and made the entire script unusable. I will modify it right now.
Last edited by serendipity on 16 Jun 2009 17:21, edited 1 time in total.
-
admin
- Site Admin
- Posts: 66312
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Fileversion
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...
I don't like this anymore!
FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: Fileversion
...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; }Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 66312
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Fileversion
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; }![]()
FAQ | XY News RSS | XY X
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Fileversion
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;
An issue o my part was, normally if i use global variable i use $g_ before the variable to identify it easily from other variables but i was in a haste and missed that.
Also you can get rid of "end true;" because your loop won't cause problems here.
Otherwise the script is quite useful i guess.
XYplorer Beta Club