Adding a hyperlink to a text string in existing PDF?

Hi Shane, that worked great, but only for PDF files (doesn’t work for JPGs). I only have a wild guess that this line:

set theLink to (current application's PDFAnnotationLink's alloc()'s initWithBounds:theBounds)

is maybe specifying a built-in function that restricts it to PDF files only? Or is it something else? All help appreciated as always!

Thanks, k

Sorry, I don’t know why it’s not woking for jpegs.

OK, thanks. I’ll do some more testing with other files and see if I can figure anything out!

Sorry for resurrecting this very old thread but the code is near a perfect match for what I need to achieve. Unfortunately I’m totally at a loss with ASObjC data types.

The two changes I need to make to the code are

  1. Use “regularExpression” of NSStringCompareOptions to find matching pieces of text.
  2. Extract the “attributedString” so I can call a function to generate a URL specific to the “attributedString”.

Unfortunately I’m totally out of my depth. Starting just with (2) the attributedString appears to be a pointer to an ASObjC data type. I presume I need cast this to a string, but for the life of me I can’t figure out how.

Any hints would be appreciated.

Thanks

S