Skip to main content
Inspiring
October 15, 2014
Question

Is it possible for Applescript to know what link is selected in the Indesign Links Palette?

  • October 15, 2014
  • 3 replies
  • 1377 views

Hi there,

I've written some ApplesScripts for Indesign that act on all links, missing links and/or selected links, but what if I wanted to perform an action on a link that is only selected in the links palette?
Is it possible for AppleScript to know which link is selected in the Indesign links palette?

Regards,

David

This topic has been closed for replies.

3 replies

Community Expert
November 25, 2021

Hi Patrick,

thanks for your contribution. As you found out getting the link of a placed and linked graphic is easy.

 

Not so if someone needs access to ( for whatever reason ) a selected link or all selected links in the Links panel.

 

An idea could be:

Invoke the menu action to embed the selected items in the Links panel.

This will change the state of some of the images in the all graphics array of the document.

One could monitor this change and work on with the result.

 

Regards,
Uwe Laubender

( ACP )

Known Participant
November 25, 2021

You can coax out the name (or any other information you need) of the link that is selected in a layout by using this method:

tell application id "com.adobe.InDesign"
    tell active document
        get name of first link whose id of parent of parent is (id of selection as integer)
    end tell
end tell

 

Participant
July 31, 2015

I'm researching this same thing, Have you found an asnwer outside of this forum?

Community Expert
July 31, 2015

Hi Dave & David,

what do you like to do with the selected links in the Links Panel?

Maybe I am missing something, but there are a couple of scenarios, I think:

A. Two or more links are selected in the Links Panel:

1. The user selected two or more images on the spread

=> The links in the Links Panel are selected as well
=> Selected images on the spread correspond with selected links

2. Same as before, but the user opened the Links Panel and selected some other links

=> Selected images on the spread do not correspond with selected links in the Links Panel

=> Menu item "Go To Link" is grayed out
=> Menu item "Embed Link" is available



B. One link is selected in the Links Panel:

=> Menu item "Go To Link" is available
=> Menu item "Embed Link" is available

In case A we could script the menu command to embed the selected links.

Before, we could store the states of embedding of all our linked graphics into an array.

After running the menu command we could check again to find out what graphics have the new embedded status.

In case B where all two mentioned menu items are available, we could script the "Go To Link" command to select the graphic in the layout. We just have to check the selection what exactly is selected.

(Not tested, just some scenarios)


Uwe

Participant
July 31, 2015

I'm trying to select a link, and then relink that selected one to a new file. If u use the

tell document 1 or tell active document

It always goes to page 1 and replaces that link.

I also can use tell page 1 because it doesn't recognize the relink command.

Sent from my iPhone