Author Topic: FocusPath/TargetPath/SourcePath empty?  (Read 20254 times)

arewar

  • Newbie
  • *
  • Posts: 4
    • View Profile
FocusPath/TargetPath/SourcePath empty?
« on: July 02, 2015, 18:14:31 »
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)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: FocusPath/TargetPath/SourcePath empty?
« Reply #1 on: July 02, 2015, 18:54:51 »
http://multicommander.com/docs/multitags

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

arewar

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: FocusPath/TargetPath/SourcePath empty?
« Reply #2 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%
« Last Edit: July 02, 2015, 23:02:57 by arewar »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: FocusPath/TargetPath/SourcePath empty?
« Reply #3 on: July 03, 2015, 05:30:43 »
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%

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


arewar

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: FocusPath/TargetPath/SourcePath empty?
« Reply #4 on: July 06, 2015, 16:48:27 »
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.