Suppose I have 2 iMacros scripts script1.iim and script2.iim, is there anyway to invoke script2.iim from within script1.iim?
Thanks.
Yes.
You can use JavaScript scripting for that purpose. Place script1.iim and script2.iim in the same folder as #Current.iim
Then you can make a JavaScript and name it test.js . In it place these codes.
iimPlay("script1.iim")
iimPlay("script2.iim")
a simple option is to combine the two scripts
Related
I'm using JSCS (google) for javascript and also JSHint, However if I autoformat my code with cmd+L it creates a space between function and an opening (. Is there anyway to tell the auto format function to obey to the coding guydes from JSCS?
You can't just tell it to obey this or that standard code style. But you can configure formatting options in Settings/Code Style/javascript. Try Spaces/Before Parentheses options: 'in function declaration', 'in function expression', 'function call parentheses'
Editor > Code Style > JavaScript
You can select Manage and import your JSCS file. This should cover the majority of your needs. Note that if you're just selecting Google from the drop down for your guide, you will need to download Googles JSCS file.
I am busy with making a macro in iMacros, but the script won't work.
The function of the script is to add autoplay=1 on a youtube video. I would need this macro to play youtube videos which don't automatically play on particular sites!
Here's my code:
SET !VAR1 (\"var test = document.getElementsByTagName('object')[0].getAttribute('data');
var test2 = test.replace(autoplay=0, autoplay=1)
document.getElementById(myytplayer).data=test2
")
Help is really appreciated!
This cannot work. In order to execute JavaScript in iMacros you have to use URL command
URL GOTO=javascript:javascriptcode;
And even this is not 100% sure way of executing JS on the web page.
I am trying to write/modify a jelly script in Jenkins Email-Ext that returns the build log. I am trying to filter the log with BUILD_LOG_REGEX for regular expressions. Can someone give me a sample script or format for doing build_log_regex using jelly script template? Thanks in advance.
The default template that you can use as your starting point is located in
$JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/html.jelly
The ${BUILD_LOG_REGEX} token is used in the Default Content section of email-ext and typically not inside of the Jelly script. To use it, just change your Default Content to reference this token:
The developer of email-ext recommended switching from Jelly to Groovy since they have "more power, its easier to use and you can prototype stuff in the script console to some degree".
See https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin#Email-extplugin-Scriptcontent
You can then look at the source code for BuildLogRegexContent class on how this token is implemented and write code to produce exactly what you want.
I want to use <cfhtmlhead> in a full script component. But it appears that it has no <cfscript> equivalent.
The CFScript reference is available here.
Is there a work around to use this functionality in a full script CFC?
You would need to write a tag based version that is then included into the script based CFC. I've done this before for things like cfsetting.
I'm using pyrocms to develop a system.
I know that, to include style links in header tag ''
in a page is by using $this->template->set_metadata().
But how can I include javascript links like that?
Any answer is appreciated.
Alternatively, if this is for a theme and the script is housed within your actual theme/js folder, it becomes:
{{ theme:js file="file.js" }}
Using just the {js} function would send it to the actual system's embedded js files.
$this->template->append_metadata(js('foo.js)) will work, or you can dump it into the view as others have suggested.
If you are creating a template you can do it like this:
{js('file.js', 'modulename')}
See the Pyro documentation.
If this is not the answer you are looking for, please explain more clearly what you want. E.g. in which file exactly do you want to include your javascript?