创建一个批处理文件来打开Firefox,然后运行一个宏(等待它完成),然后运行另一个宏 [英] create a batch file to open firefox, then run a macro (wait for it to finish) then run another macro

查看:1315
本文介绍了创建一个批处理文件来打开Firefox,然后运行一个宏(等待它完成),然后运行另一个宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想:
(1)负载火狐
(2)运行Iopus Imacro(.iim) - 等待此结束,然后
(3)运行一个宏。

到目前为止,我已经尝试启动/等待 - 呼叫和其他许多建议,我能找到所有在互联网上,这是我迄今(它运行完美 - 只要有只有一个宏文件(。 IIM)扮演):

  @ECHO ON
回声
ECHO你有5秒从运行关闭此窗口为prevent宏...
超时5
ECHO启动Firefox并等待10秒钟......
启动/ B,C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe
超时10
ECHO现在运行宏(在第2个选项卡)...
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro1.iimREM宏执行完毕
ECHO完了!

当我尝试添加更多的文件来运行,这样的:

  @ECHO ON
回声
ECHO你有5秒从运行关闭此窗口为prevent宏...
超时5
ECHO启动Firefox并等待10秒钟......
启动/ B,C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe
超时10
ECHO现在运行宏(在第2个选项卡)...
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro1.iim
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro2.iim
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro3.iimREM宏执行完毕
ECHO完了!

Firefox启动,然后加载所有.iim文件进行一次,但他们都没有运行。

我也尝试创建多个批处理文件,这样,一会跑,然后调用第二个时,一日一结束后...没有工作!

这code <一个href=\"http://stackoverflow.com/questions/14383576/launch-macros-one-by-one-from-a-batch-file\">launch-macros-one-by-one-from-a-batch-file

  CD C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\
启动firefox.exe
平-n 05 127.0.0.1&GT;空
启动/等待firefox.exe的iMacros://运行/ M = unlimited1.iim
启动/等待firefox.exe的iMacros://运行/ M = unlimited2.iim

入门2 Firefox窗口,但没有运行任何的宏!

@foxdrive - 这里是我在评论中提到@晚上9点或code左右....

 `@ECHO ON
回声
ECHO你有5秒从运行关闭此窗口为prevent宏...
超时5
ECHO启动Firefox并等待10秒钟......
启动/ B,C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe
超时10
ECHO现在运行宏(在第2个选项卡)...
设置临时文件= C:\\用户\\公用\\文档\\ iMacros的\\宏\\ flag.txt
键入NUL&gt;中%临时文件%
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exeiMacros的://运行/ M =mymacro1.iim
:循环1
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环1键入NUL&gt;中%临时文件%
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exeiMacros的://运行/ M =mymacro2.iim
:循环2
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环2键入NUL&gt;中%临时文件%
C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exeiMacros的://运行/ M =mymacro3.iim
:循环3
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环3REM宏执行完毕
ECHO完了!`


解决方案

现在,当他们完成宏删除临时文件,这应该工作:

 关闭@echo
ECHO你有5秒从运行关闭此窗口为prevent宏...
超时5
ECHO启动Firefox并等待10秒钟......
启动/ B,C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe
超时10
设置临时文件= C:\\用户\\公用\\文档\\ iMacros的\\宏\\ flag.txt
回声宏观运行1
键入NUL&gt;中%临时文件%
启动/ W / BC:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro1.iim
:循环1
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环1
回声宏观运行2
键入NUL&gt;中%临时文件%
启动/ W / BC:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro2.iim
:循环2
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环2
回声宏观运行3
键入NUL&gt;中%临时文件%
启动/ W / B C:\\ Program Files文件(x86)的\\ Mozilla Firefox的\\ firefox.exe的iMacros://运行/ M =mymacro3.iim
:循环3
如果存在%临时文件%平-n 10本地主机&GT; NUL&安培;转到:循环3

I am trying to: (1) load Firefox (2) run Iopus Imacro (.iim) - wait for this to finish, then (3) run the next macro.

So far I have tried start /wait - call and as many other suggestions as I could find all over the internet and this is what I have so far (which runs flawlessly - as long as there is only one macro file (.iim) to play):

@ECHO ON
ECHO
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
ECHO Now running the macro (in a 2nd Tab)...
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro1.iim"

rem Macro Execution completed
ECHO FINISHED!

When I try to add more files to run, like this:

@ECHO ON
ECHO
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
ECHO Now running the macro (in a 2nd Tab)...
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro1.iim"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro2.iim"    
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro3.iim"

rem Macro Execution completed
ECHO FINISHED!

Firefox starts and then loads ALL of the .iim files at once, BUT NONE of them run.

I also tried creating more than one batch file, so that one would run, then call a second one when the 1st one finished ... didn't work!

This code launch-macros-one-by-one-from-a-batch-file

cd C:\Program Files (x86)\Mozilla Firefox\
start firefox.exe
ping -n 05 127.0.0.1>null
start /wait firefox.exe imacros://run/?m=unlimited1.iim
start /wait firefox.exe imacros://run/?m=unlimited2.iim

Started 2 firefox windows but did not run any macros!

@foxdrive - here is the code that I mentioned in the comments @ 9pm or so ....

`@ECHO ON
ECHO
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
ECHO Now running the macro (in a 2nd Tab)...
set "tempfile=C:\Users\Public\Documents\iMacros\Macros\flag.txt"
type nul>"%tempfile%"    
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro1.iim"
:loop1
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop1

type nul>"%tempfile%"    
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro2.iim"   
:loop2
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop2

type nul>"%tempfile%"    
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro3.iim"
:loop3
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop3

rem Macro Execution completed
ECHO FINISHED!`  

解决方案

Now that the macros delete this temp file when they finish, this should work:

@echo off
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
set "tempfile=C:\Users\Public\Documents\iMacros\Macros\flag.txt"
echo macro 1 running
type nul>"%tempfile%"    
start "" /w /b "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro1.iim"
:loop1
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop1
echo macro 2 running
type nul>"%tempfile%"    
start "" /w /b "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro2.iim"    
:loop2
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop2
echo macro 3 running
type nul>"%tempfile%"    
start "" /w /b C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro3.iim"
:loop3
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop3

这篇关于创建一个批处理文件来打开Firefox,然后运行一个宏(等待它完成),然后运行另一个宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆