如何在imacros中使用JavaScript? [英] How to use JavaScript in imacros?

查看:244
本文介绍了如何在imacros中使用JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚如何在JavaScript中使用imacros。我看过他们的帮助,在Stack Overflow上看到了无数的例子,但不知道遗漏了什么。它在任何地方都没有得到清楚的解释。

I can't figure out how to use imacros with JavaScript. I have looked at their Help, have seen countless examples here on Stack Overflow, but don't know what am missing. It has not been explained clearly anywhere.

这是我试过的:


  1. 使用其帮助文件中解释的示例:
    http://wiki.imacros。 net / JavaScript

但点击点击此处运行链接时没有任何反应(即使在IE中使用ActiveX)。注意:我没有IE的imacros - 上面显示的示例包含IE中的宏启动图像,但在Firefox中运行。没有进一步的解释..

But nothing happens when I click the 'Click Here to Run' link (even in IE with ActiveX). NOTE: I don't have imacros for IE - the example shown above has image of the macro start in IE, but run in Firefox. And no further explanation..

试图将一个JS文件导入imacros,但它似乎对我没用。

Tried to import a JS file into imacros, but it doesn't seem to be working for me.

当我使用如下代码时:

var macro;
macro = "CODE:";
macro += "XXXXXX" + "\n";
macro += "XXXXXX" + "\n";

....
iimPlay(macro);

它说:

"Error -1100: Unknown command: VAR at line: 1"




  1. 尝试在HTML页面的脚本标记内使用上述内容,&在页面加载/单击上加载函数。但这也不起作用。

我做错了什么,我需要做什么?

What am I doing wrong, and what do I need to do?

我发布此消息后不久,我想我已经让它工作了一段时间。我能够打开一个打开URL的JS文件。所以我已经删除了Q.但现在它再次无法工作,我无法弄明白为什么..有人可以帮忙吗?

Soon after I posted this, I think I got it to work for a while. I was able to open a JS file which opened a URL. So I had deleted the Q. But now it isn't working again, and I can't figure out why.. Can somebody help?

基本上我有与此人完全相同的问题:
Javascript和Imacro打开Goog​​le .com 我和他一样得到了同样的'未知命令:var'。他们的问题也没有得到解决。

Basically I am having the exact same problem as this person here: Javascript and Imacro to Open Google.com I get the same 'unknown command: var' as him. And their question remains unresolved too.

推荐答案

看起来你正试图在iim文件中运行javascript。打开记事本或其他文本编辑器并粘贴以下代码:

It looks like you are trying to run javascript inside an iim file. Open notepad or another text editor and paste the following code:

var test;
test ="CODE:";
test +="SET !ERRORIGNORE YES "+"\n";
test +="URL GOTO=www.google.com "+"\n";

iimPlay(test)

使用.js扩展名保存文件。接下来打开firefox和iMacros插件。转到管理 - >设置 - >路径选项卡 - >文件夹数据源。输入上面保存文件的路径。通过单击iMacro按钮打开和关闭来刷新iMacros。 javascript文件应显示在左侧窗格中。运行该文件进行测试。

Save the file with a .js extension. Next open up firefox and the iMacros addon. Go to Manage -> Settings -> Paths Tab -> Folder Datasource. Enter the path where you saved the file above. Refresh iMacros by clicking the iMacro button on and off. The javascript file should show up in the left pane. Run the file to test.

< img src =https://i.stack.imgur.com/8OVp1.pngalt =文件夹数据源>

你应该注意到文件名左侧的图标与javascript文件不同,扩展名为.js而不是.iim。

You should notice the icon to the left of the file name is different for the javascript files and the extension is ".js" instead of ".iim".

这篇关于如何在imacros中使用JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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