Author Topic: MultiTag for Opening Current Focus *FileName* Only /w a Program  (Read 442 times)

total_annihilation00

  • Active Member
  • ***
  • Posts: 75
  • Tech Savant\ Envisioneering
    • View Profile
I need the MultiTag to open the currently selected file (via Custom Menu) to the app, without the path, only the filename without the extension even, and certainly not the full filepath. When I enter this in MSDOS it works: "C:\Users\dell\Documents\fba64_029743\fba64.exe garou" (without quotes) but in MultiCommander I tried both variants of ${focusfilepath}: ${focusfilename} (returns only the name of the file that is currently in focus, without its path) and ${focusfile} (identifier to return the filename with its extension) but they both don't work (I'am entering these as a User Defined Command (External Command) into Custom Menu so I can right-click a file & open the game ROM selected in the FB Alpha program, as a command-line parameter (it accepts filenames only, w/o path and extension.) Please help me find the right MultiTag/identifier for this.
« Last Edit: January 15, 2025, 15:47:55 by total_annihilation00 »
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~


Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 561
  • Old Skull
    • View Profile
Re: MultiTag for Opening Current Focus *FileName* Only /w a Program
« Reply #1 on: January 15, 2025, 14:58:30 »
If I get you right, you might need MultiScript function PathGetNamePart

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4533
    • View Profile
    • Multi Commander
Re: MultiTag for Opening Current Focus *FileName* Only /w a Program
« Reply #2 on: January 15, 2025, 15:01:06 »
Use MultiScript instead of external. then you can manipulate the path and change what you want

For multiscript you have PathGetNamePart(..) that can return filename without extension.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4533
    • View Profile
    • Multi Commander
Re: MultiTag for Opening Current Focus *FileName* Only /w a Program
« Reply #3 on: January 15, 2025, 15:04:14 »
Something like
Code: [Select]
@var $file = GetSourceFocusPath();
$file = PathGetNamePart($file, 1);

MC.Run CMD="C:\ExeToRun.exe" ARG="{$file}"

total_annihilation00

  • Active Member
  • ***
  • Posts: 75
  • Tech Savant\ Envisioneering
    • View Profile
Re: MultiTag for Opening Current Focus *FileName* Only /w a Program
« Reply #4 on: January 15, 2025, 15:29:47 »
Thanks, I got it to work thanks to both of your help. AI helped write the MultiScript:

Code: [Select]
@var $name = PathGetNamePart( GetSourceFocusPath(), 1 );
MC.Run CMD="C:\\Users\\dell\\Documents\\fba64_029743\\fba64.exe" ARG="{$name} -r 1366x768x32"
~The World's Deceit Has Raped My Soul, We Melt The Plastic People Down Then We Melt Their Plastic Town~