# Conditional FindInLine equivalent in source scripts?

**URL:** https://community.mp3tag.de/t/conditional-findinline-equivalent-in-source-scripts/10660
**Category:** Web Sources Discussion
**Created:** [August 15, 2010, 7:12pm UTC](https://community.mp3tag.de/t/conditional-findinline-equivalent-in-source-scripts/10660 "2010-08-15T19:12:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![igorshergin](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/e5b9ba/32.png) [@igorshergin](https://community.mp3tag.de/u/igorshergin)
#### Post date: [August 15, 2010, 7:12pm UTC](https://community.mp3tag.de/t/conditional-findinline-equivalent-in-source-scripts/10660/1 "2010-08-15T19:12:58Z")

</div>

I'm spending my second hour on scripting, and just realized that it's impossible to understand inside the script that some text is exists. If and Do/While operators does their job only for current cursor position. The result is nice scripting like this:

```
# Primary Cover - backasswards because FindInLine 
# does exception if nothing found
FindInLine "<artists>"
MoveChar -18
If "</images>"
    # We sure now that primary image exists
    OutputTo "COVERURL"
    GotoChar 1
    FindInLine "type=\"primary\" uri=\""
    SayUntil "\""
EndIf

```

Luckily tag in this particular case always exists. If less lucky, the puzzle could be unresolvable.

It would be great to have something like, for example, IfExists operator:

```
# Primary Cover
IfExists "<image type=\"primary\""
    OutputTo "COVERURL"
    GotoChar 1
    FindInLine "<image type=\"primary\" uri=\""
    SayUntil "\""
EndIfExists
```
