O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – extracting a list of media links

There probably is a regular expression that would extract all of the "src" links from a page, but we're only interested in things that we know LiveCode is able to show or play. So this time we'll use a more devious way to extract just the links we can handle.

  1. You may as well head over to the test stack!
  2. Make a third button by duplicating one of the other two, and change the getLinks or getText part in the button script to call getMedia instead.
  3. In the stack script, enter all of this:
    global gPageURL function getMedia pPageSource put ".jpg,.png,.gif,.jpeg,.mov,.mp4,m4v,.mp3" into tExtensions repeat with a = 1 to the number of items in tExtensions put item a of tExtensions into tExtension replace tExtension ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required