Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Applescript hyperlink URL, not shared destination

$
0
0

Hi everyone,

i'm trying to write an applescript that will apply a hyperlink to some selected text (a product number). Where I am running into trouble is that the hyperlinks cannot be "shared destination".

After poaching what I could from some other scripts, I have this:

 

tell application "Adobe InDesign CS5"

   

    tell document 1

        set mySelection to selection

       

        set prodNo to contents of mySelection as string

        set prodNoURL to "http://www.webaddress.com/address/" & prodNo as string

       

        try

            set TheH to make hyperlink URL destination with properties {name:prodNo, destination URL:prodNoURL}

        on error

            set TheH to hyperlink URL destination prodNo

        end try

        set TheHS to make hyperlink text source with properties {source text:(item 1 of mySelection), hidden:false}

        set myHyperlink to make new hyperlink with properties {destination:TheH, source:TheHS, visible:false}

               

    end tell

end tell

end

 

This works, except that the resulting hyperlinks are linking to Shared Destination, which they cannot do (I don't know why, actually; my little script is just one step in a bigger process.)

Screen Shot 2013-02-25 at 4.11.18 PM.png

How do I create a hyperlink that will link to URL, with the "Shared Destination" checkbox OFF:

Screen Shot 2013-02-25 at 4.13.41 PM.png

 

Thanks for your help!

(Mac OS 10.7, ID CS5)


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>