Automation and ruby - listing largest files
Posted: 15 Feb 2016, 11:34
After I have manged to use Ruby as other COM language in the Automation plugin, I wanted to write more complex script to show and test the possibilities. I have decided to share for anyone who would like to write in ruby too.
Script displays n (user input) largest files at the path entered by the user (take from Salamander panel, but user can overwrite it). Nothing life changing but, at least for me, practical. I also wanted to have some framework for next scripts.
Nearly everything worked as it should. The biggest issue was caused Salamander.AbortScript(), because for unknown reason that has hang whole salamander when executed. I wanted to abort the script when user pressed cancel at InputBox (from what I tested it works for jscript and vbsript). I have circumvented the issue by managing the program workflow.
I hope someone will enjoy the script too .).
EDIT: New version of the file - to fix the cancel button even after wrong user answer. Should be final version.
Script displays n (user input) largest files at the path entered by the user (take from Salamander panel, but user can overwrite it). Nothing life changing but, at least for me, practical. I also wanted to have some framework for next scripts.
Nearly everything worked as it should. The biggest issue was caused Salamander.AbortScript(), because for unknown reason that has hang whole salamander when executed. I wanted to abort the script when user pressed cancel at InputBox (from what I tested it works for jscript and vbsript). I have circumvented the issue by managing the program workflow.
I hope someone will enjoy the script too .).
EDIT: New version of the file - to fix the cancel button even after wrong user answer. Should be final version.