How to make imacros WAIT if a specific text string exists on a website? - imacros

Question in the title
Is there a non JavaScript method
Can I use eval command
Thanks in advance

You can build on this to wait if a certain String exists:
TAG POS=1 TYPE=* ATTR=* EXTRACT=HTM
SET timeout_time EVAL("'{{!EXTRACT}}'.includes('text to find')? 5 : 0")
WAIT SECONDS={{timeout_time}}
I just used a TAG that grabs everything, feel free to change that to look for your String in a more narrow context. The extracted text is then searched for your text to find, if it exists it will wait 5 seconds, otherwise 0.

Related

Sublimetext "Close Tag" command doesn't work with Django static tags

For some reason, when I am programming in SublimeText with Python / Django,%} tags interfere with Sublime's 'Close Tag' function.
Here's an example of what I'm talking about in practice. It's an <img> tag that references a static file within an outer <div>. Notice that the %} tag is white — Sublime has, for some reason, not recognized it as valid code:
When I position my cursor at the other end of this line and use the 'Close Tag' command, I would expect sublime to close my </div>. Instead, it does this:
Any idea how to fix this problem?

AppleScript how to find pattern and set it to a record or list?

In AppleScript I know how to do a typical find with something like:
tell application "BBEdit"
activate
open find window
find "memberFunction\\(\\)" searching in text 1 of text document "theFile" options {search mode:grep, wrap around:true} with selecting match
end tell
and I can do a multi file search find:
tell application "BBEdit"
activate
find "memberFunction\\(\\)" searching in {file "path:to:project.bbprojectd:"} options {search mode:grep, showing results:true}
end tell
but I'd like to return the find multi result and save it to a file so I thought I'd need to save it to a record or list then repeat through the input but when I try:
tell application "BBEdit"
activate
set findFunction to {}
set findFunction to {find "memberFunction\\(\\)" searching in {file "path:to:project.bbprojectd:"} options {search mode:grep, showing results:true}} as list
end tell
or:
set findFunction to {find "memberFunction\\(\\)" searching in {file "path:to:project.bbprojectd:"} options {search mode:grep, showing results:true}} as record
I get an error of:
No result was returned from some part of this expression.
Why is the find not being set to the record or list? Is there a way I can set what the multi-file search does?
The error is that you put the find command in a list.
To get a record from the find command:
The showing results property must be false and the returning
results property must be true, otherwise the findFunction
variable will be undefined
Here's the script:
tell application "BBEdit"
set findFunction to find "memberFunction\\(\\)" searching in file "path:to:project.bbprojectd:" options {search mode:grep, showing results:false, returning results:true}
end tell

need help for Imacros

please anybody can help me on my query. I am using Imacros. I want to extract from URL. last number of next page. the problem is when I run the url the next page number is just blink once. is there any solution where I can stop autojavascript and extract Laast Number
I dont know how to write code here is the URL
http://www.justdial.com/Jamnagar/Architects/page-50
Here its shwo just once maximum page is 5 so I want to extract that (5) number.
look in to IMAGE
thanks in Advance
use this command
TAG POS=1 TYPE=DIV ATTR=CLASS:sec-1<SP>col-sm-5<SP>hidden-xs EXTRACT=TXT

mutt - index search on yanked text

I'm wondering if there is anyway to "search" or "limit" in the mutt index based on text yanked from either an "edit" or "page" mode.
I'm trying to build a macro for the index, that when pressed will limit the index to only mail from (~f) the From: .*$ regex of the current item.
What this will help me to do is see the context of all the messages from a particular sender... it also helps when people accidentally "break threads" when they shouldn't.
I was hoping it would be similar to vim as discussed here and i could yank text from one area and then type ^R" to paste back into the "search" or "limit" prompt.
I tried to make a macro to go into edit and then search for the from string, but i can't figure out how to paste it back into anything in the index...
Here is an incomplete (and ugly) solution:
macro index O "|grep ^From | awk 'NR==1 {printf \"macro index Q l%s\",$2}' > /tmp/from;echo>>/tmp/from\n:source /tmp/from\nQ"
The O macro will extract the from address from the current message, and save a new macro definition to /tmp/from.
Then it will source that definition, and finally execute it.
Note: I'm having trouble adding newlines in the script (that's the reason for the echo>>, and the need for you to press enter at the end of the limit prompt. Will try to improve this.

Regex and Autohotkey - extract pdf name and page number from query string

I handle many documents on a day to day basis and was using regular expression and Autohotkey to open a particular page of pdf from a given string. For ex, I will copy the below string including the parenthesis and press a hotkey
(16G3537-2011 tax return-page 25)
Any my below Ahk code would open the 25th page in the pdf 16G3537-2011 tax
RegExMatch(clipboard,"i)\((.*)\s*-page\s*(\d+)\)",part)
Run, %Adobelocation% /A page=%part2% %copyz%/%part1%.pdf"
Adobelocation is the location of adobe reader in my computer
copyz is the location of folder where the pdf is located
I know AHK to some extent, but have difficulty with regular exp. Now my query string has been modified to just
16G3537-2011 tax return.pdf_pages 25
I am really at a loss to make my code open the 25th page using the modified string. Kindly help me.
Edit:
The command line for this code is
Run, pathto\Acrobat.exe /A "page=" part2 " C:\folder\" part1 ".pdf"
Try
RegExMatch(clipboard,"i)(.*)\s*\.pdf_pages\s*(\d+)",part)
Run, %Adobelocation% /A page=%part2% %copyz%/%part1%.pdf"
The difference to the original regex is the Elimination of the parenthesis matching (\(, \)) and the Substitution of the separator Char in Front of the page specific (\. instead of -).
Note That since the parentheses around the file name have been dropped, you'd need some other Marker to indicate the Start of the relevant expression if you'd Extract from embedding Text. The context you give suggests that this is not necessary in your Case ( the clipboard containing only the relevant data), but keep it in mind when reusing the regex.
Still wondering why return would not be Part of the extracted file name, but you Write that the original Works so i let this Aspect Rest.