Multi Commander > Script

FocusPath/TargetPath/SourcePath empty?

(1/1)

arewar:
I'm trying to make a button that runs a program with certain directory information. I'm creating a user command batch script.

This is what I have in my script area. It changes to the directory I need, runs the program and feeds in the "focusfilepath". What I show below works great, but what I need is ${focuspath} instead of focusFILEpath. When I use ${focuspath} it does not give me any data, it's just empty.

I've also tried targetpath and sourcepath, which are also empty. But their FILE-counterparts work too. Am I missing something to get just the directory?

D:
cd D:\Test\_QA\check
CreateChecksum -NODB "${focusfilepath}" 5000000 0

Mathias (Author):
http://multicommander.com/docs/multitags

use ${sourcepath} to get the path of the active panel. 

arewar:
As I said... I tried sourcepath, targetpath, and focus path.

I've tried again to verify and have the same results. ${sourcepath} gives no information. ${sourcefocuspath} however, does return a selected file.


Edit - is it possible to store these in variables in Batch files?

Success:
echo ${sourcepath}

Failure:
set test = ${sourcepath}
echo %test%

Mathias (Author):

--- Quote from: arewar on July 02, 2015, 22:41:41 ---As I said... I tried sourcepath, targetpath, and focus path.

I've tried again to verify and have the same results. ${sourcepath} gives no information. ${sourcefocuspath} however, does return a selected file.


Edit - is it possible to store these in variables in Batch files?

Success:
echo ${sourcepath}

Failure:
set test = ${sourcepath}
echo %test%

--- End quote ---

It works.. But you need to write it correct..  bat files do not like spaces.
set test=${sourcepath}

arewar:
Thank you. Apologies for my stupidity!

I figured out the reason for my problem was the sourcepath was giving me a trailing slash, which caused my program to fail and therefore appear to be empty. Your comment helped me get it in a variable, so then I could edit the string to be what I needed.

set test=${sourcepath}
set newtest=%test:~0,-2%"
echo %newtest%
D:
cd D:\Test\_QA\check
CreateChecksum -NODB %newtest% 5000000 0
pause

Thanks for your assistance.

Navigation

[0] Message Index

Go to full version