https://github.com/vikilpet/Taskopy
than can be used to process file paths from Total Commander.
Example task: Virustotal check and group renaming
Code: Select all
def from_total_commander_demo(
submenu='demo'
, hotkey='alt+f12'
, hotkey_suppress=False
):
time_sleep('10 ms')
file_lst = clip_get().split('\r\n')
ext = file_ext(file_lst[0]).lower()
if ext in ('exe', 'msi'):
# This is an executable file(s), so let's
# calculate its hash and open links on Virustotal:
for fname in file_lst:
sha256 = file_hash(fname, 'sha-256')
file_open(f'https://www.virustotal.com/gui/file/{sha256}')
elif file_name(file_lst[0]).startswith('IMG_'):
# This is a photo or video. Let's change the time format
# and add a description:
prefix = inputbox('Prefix:')
if prefix == '': return
pattern = r'(img|vid)_(\d\d\d\d)(\d\d)(\d\d)_(\d\d)(\d\d)(\d\d)'
for fname in file_lst:
new_name = re_replace(file_name(fname), pattern
, r'_\2.\3.\4_\5-\6-\7')
file_rename(fname, prefix + new_name)