Multi Commander > Support and Feedback

MultiTag for Opening Current Focus *FileName* Only /w a Program

(1/1)

total_annihilation00:
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.

Jungle:
If I get you right, you might need MultiScript function PathGetNamePart

Mathias (Author):
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):
Something like

--- Code: ---@var $file = GetSourceFocusPath();
$file = PathGetNamePart($file, 1);

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

total_annihilation00:
Thanks, I got it to work thanks to both of your help. AI helped write the MultiScript:


--- Code: ---@var $name = PathGetNamePart( GetSourceFocusPath(), 1 );
MC.Run CMD="C:\\Users\\dell\\Documents\\fba64_029743\\fba64.exe" ARG="{$name} -r 1366x768x32"
--- End code ---

Navigation

[0] Message Index

Go to full version