Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
foreach f files ...counter
#1
i hope thats not a stupid question from me,
but what is the shortest way to get foreach count?


Function cmd_prompt
Trigger ^Shell_menu "cmd here" 0x11 "" "" "open cmd prompt with selected path"     Help - how to add the trigger to the macro
Code:
Copy      Help
function $files
str f

foreach f files
,_i+1
,if _i<2
,,out f
,,;ChDir f ;;obsolete?
,,SetCurDir f
,,run "cmd.exe"
,else
,,out "doh!"


// cmd.exe
;spe -1
;str d="d:\downloads"
;str p.from("/k cd d:\downloads")
;ChDir d
;run "cmd.exe"
;RunConsole("c:\" "cd d:\downloads")
pi
#2
can RunConsole be used to open command prompt in a given folder?
pi
#3
Why RunConsole? run will do it.
run "cmd.exe" "/K cd folder"
#4
Gintaras Wrote:run "cmd.exe" "/K cd folder"

doh!

you need to add a finishing backslash to folder.

Function cmd_prompt
Trigger ^Shell_menu "cmd here" 0x11 "" "" "open cmd prompt with selected path"     Help - how to add the trigger to the macro
Code:
Copy      Help
function $files
str f

foreach f files
,_i+1
,if _i<2
,,str p.from("/K cd " f "\")
,,run "cmd.exe" p
,else
,,out "doh!"
pi
#5
Gintaras Wrote:Why RunConsole?

because i guess that i then can use qm for cmd tasks.
like having a transparent toolbar with some buttons.

i would like to automate my old paste routine.
pi
#6
i have a working solution for overlaying an area with a transparent toolbar.
ones attached to cmd you can also drop a folder or files on it.
pi
#7
Enter a file path in an existing cmd window? I don't know other ways than key/outp/setsel.

run and RunConsole open new cmd window.


Forum Jump:


Users browsing this thread: 1 Guest(s)