• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Oct 14, 2014 Oct 14, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 30, 2015 Jul 30, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 31, 2015 Jul 31, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 31, 2015 Jul 31, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 31, 2015 Jul 31, 2015

Copy link to clipboard

Copied

Sorry Dave, I can't help with AppleScript code.

I'm with ExtendScript.

The basic idea of my suggestions is to use menu script commands (opposed to directly manipulate objects on the spreads or links by name or id or index).

As you already found out, you cannot know directly what link is selected in the Links Panel. And you cannot select a link in the Links Panel by scripting. So my idea is to just check if several script menu items in the Links Panel are available (not grayed out) and act upon their results after activating them.

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2021 Nov 24, 2021

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2021 Nov 25, 2021

Copy link to clipboard

Copied

LATEST

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines