Passing data through clipboard between filters
Posted: Tue Oct 05, 2010 2:36 am
I am trying to make use of the @clipboard variable in a series of filters but I am not getting the desired results.
The script should take an html file and restrict itself to a table cell. In that cell is an image that is linked. The link has three parts to the path and I need the third part. The third part is then copied to the clipboard so it can be used to replace the text in the image's ALT tag.
Filter List
-----------
Filter options
| [ ] Log to file
| [X] Append to logfile
| Log filename: textpipe.log
| Threshold 500
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Skip binary files
| Sample size 100 characters
|
|--Restrict to between tags <td>...</td>
| | [X] Include text
| | [ ] Match case
| | Max size: 65536
| |
| |--Restrict to between tags <a>...</a>
| | | [X] Include text
| | | [ ] Match case
| | | Max size: 65536
| | |
| | +--EasyPattern [href="/[capture(2 to 3 letters)]_[capture(1 to 5 digits)]/[capture(1+ chars or punctuation) as 'clipboard']"] with ["/$1_$2/"]
| | | [ ] Match case
| | | [ ] Whole words only
| | | [ ] Case sensitive replace
| | | [ ] Prompt on replace
| | | [ ] Skip prompt if identical
| | | [ ] First only
| | | [ ] Extract matches
| | | Maximum text buffer size 4096
| | |
| | +--Capture to variable @clipboard
| | Reset: 2
| |
| +--EasyPattern [alt="[1+ chars or punctuation]"] with [alt="@clipboard"]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [X] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
|
So, now that I am reviewing what I pasted... I'm not sure why the EasyPattern is being replaced with "/$1_$2/" unless that is how it handles "send variable 3 to subfilter". Should I use an Extract filter? Originally, whenever I used an Extract filter it would actually remove the text that I wanted to keep.
I know this doesn't work but the more I tinker the more I stray from the solution. How is the best way to handle the hand off of data from the href="" to the enclosed image's ALT tag?
Thank you in advance.
The script should take an html file and restrict itself to a table cell. In that cell is an image that is linked. The link has three parts to the path and I need the third part. The third part is then copied to the clipboard so it can be used to replace the text in the image's ALT tag.
Filter List
-----------
Filter options
| [ ] Log to file
| [X] Append to logfile
| Log filename: textpipe.log
| Threshold 500
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Skip binary files
| Sample size 100 characters
|
|--Restrict to between tags <td>...</td>
| | [X] Include text
| | [ ] Match case
| | Max size: 65536
| |
| |--Restrict to between tags <a>...</a>
| | | [X] Include text
| | | [ ] Match case
| | | Max size: 65536
| | |
| | +--EasyPattern [href="/[capture(2 to 3 letters)]_[capture(1 to 5 digits)]/[capture(1+ chars or punctuation) as 'clipboard']"] with ["/$1_$2/"]
| | | [ ] Match case
| | | [ ] Whole words only
| | | [ ] Case sensitive replace
| | | [ ] Prompt on replace
| | | [ ] Skip prompt if identical
| | | [ ] First only
| | | [ ] Extract matches
| | | Maximum text buffer size 4096
| | |
| | +--Capture to variable @clipboard
| | Reset: 2
| |
| +--EasyPattern [alt="[1+ chars or punctuation]"] with [alt="@clipboard"]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [X] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
|
So, now that I am reviewing what I pasted... I'm not sure why the EasyPattern is being replaced with "/$1_$2/" unless that is how it handles "send variable 3 to subfilter". Should I use an Extract filter? Originally, whenever I used an Extract filter it would actually remove the text that I wanted to keep.
I know this doesn't work but the more I tinker the more I stray from the solution. How is the best way to handle the hand off of data from the href="" to the enclosed image's ALT tag?
Thank you in advance.