• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: extract URL from general text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extract URL from general text


  • Subject: Re: extract URL from general text
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 19 Mar 2008 00:20:40 -0400

Saying that you think AppleScript is good for parsing text removes the
need to also say you don't know Perl. ;-)  But the idea that you need
any extra modules to grab URLs in Perl is ludicrous.

Still, while AS by itself may not shine at anything more complicated
than simple search/replace, it does shine at scripting other apps
that, in turn, shine at manipulating text.  Like, say, BBEdit.  If
your text is in BBEdit, you should let it do the heavy lifting - it's
very powerful.  This might work (untested):

tell application "BBEdit"
   replace "https?://\\S+" using "<a href=\"&\">&</a>" options {search
mode: grep}
end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: extract URL from general text (From: "Gary (Lists)" <email@hidden>)

  • Prev by Date: Re: Creating A Property List File
  • Next by Date: Re: Which version of InDesign created a document?
  • Previous by thread: Re: extract URL from general text
  • Next by thread: Re: extract URL from general text
  • Index(es):
    • Date
    • Thread