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

Auto Link in InDesign

Participant ,
Oct 18, 2018 Oct 18, 2018

Copy link to clipboard

Copied

Hi Experts,

I need a script which needs automatically place as inline image wherever specific text as XX.eps, XX.ai, come in the document. I have exactly environment as below link. Although, this is a paid script but didn't afford at my end.

http://www.nikkimgroup.com.au/features/placing-artwork

I have 250+ images to link in the docs.

Thanks very much in advance.

Amit

TOPICS
Scripting

Views

2.2K

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

correct answers 3 Correct answers

Participant , Nov 20, 2018 Nov 20, 2018

Thanks Colin for your response.

I have tried this script on InDesign CC2018 but did not happen anything after triggered the script.

Amit

Votes

Translate

Translate
Community Expert , Nov 20, 2018 Nov 20, 2018

If i understand correctly you want to include names that can contain space and - as well, for that you will have to change the grep expression. Change it to the following

"\\b([A-Za-z0-9_ \\-]+\\.ai|[0-9A-Za-z_ \\-]+\\.eps)\\b"

Votes

Translate

Translate
Participant , Nov 21, 2018 Nov 21, 2018

Thank you, Manan.

It works flawlessly. Undoubtedly you are rock mate.

Thanks again for this tremendous script.

Now there is no question regarding this topic. It is obviously close now.

Regards,

Amit

Votes

Translate

Translate
Participant ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

Hi Manan,

Hurrayy!!

Thank you very much!! You rock mate!!

I don't have enough words to appreciate your extremely help.

Now, I can say that there is someone to help us!!

Regards,

Amit

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
Participant ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

Mate,

Moreover, one last thing that I have much graphics with different format i.e., ai, eps, psd, jpg, png, gif, tif, etc. I have add them and change the format of the file as snapshot.

Screen Shot 2018-11-21 at 1.39.01 PM.png

Is it possible to give them in a single line code??

Please suggest.

Amit

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 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

Try the following regex, it will cater to all the extensions that you mentioned and is a lot shorter than the one in use currently

"\\b([A-Za-z0-9_ \\-]+\\.(?:ai|eps|psd|jpg|png|gif|tif))\\b"

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
Participant ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

Thank you, Manan.

It works flawlessly. Undoubtedly you are rock mate.

Thanks again for this tremendous script.

Now there is no question regarding this topic. It is obviously close now.

Regards,

Amit

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
Participant ,
Jan 02, 2019 Jan 02, 2019

Copy link to clipboard

Copied

Hi Manan,

Hope you are well.

Now, I have another need on that script as I want to proportionally scale 70% all the graphics which are fetched from the link folder on the desktop.

Can you please help me out here.

Regards,

Amit

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 ,
Jan 02, 2019 Jan 02, 2019

Copy link to clipboard

Copied

Hi Amit,

I am not clear on what is needed. In the previous script we placed the images from a folder, now once those are placed you need to scale them horizontally and vertically by 70%?

Or is this an altogether new script that would search the document for all the images placed from the Link folder on Desktop and then scale these images vertically and horizontally by 70%?

Can you share some snippet that you tried and did not work as needed.

-Manan

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
Participant ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Hi Manan,

Thanks for your reply.

Yes, we need the 2nd option below.

"is this an altogether new script that would search the document for all the images placed from the Link folder on Desktop and then scale these images vertically and horizontally by 70%?"

Please suggest.

Regards,

Amit

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 ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Hi Amit,

Go through the discussion in the following link, this should lead you to a solution

[AS] Find images and scale

Also since this is an new query i would suggest you to open up a new question, and not continue this thread as its already been marked answered and hence it would not attract attention from folks who might be able to help you further.

-Manan

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
Participant ,
Jan 15, 2019 Jan 15, 2019

Copy link to clipboard

Copied

Hi Manan,

Thanks for provided the url.

I will try to resolve my end, if possible, otherwise, will post a new requirement.

Amit

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
Participant ,
Jan 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

LATEST

Thanks Manan.

Provided link worked for me.

Regards,

Amit

To approve a single suggestion, mouse over it and click "✔"
Click the bubble to approve all of its suggestions.

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 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

https://forums.adobe.com/people/Manan+Joshi  wrote

This is getting really confusing, seems i am creating more confusion then clarity.

No worries there, it isn't you.

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
Enthusiast ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

First, don't change the filename extension (leave it as .scpt). [Note: The format you choose when you save the script determines the file extension--you should not have to "change" the extension. Saving it as "text" gives it the .applescript extension.] Second, the script is expecting a folder named graphics on the Desktop that contains the files. Third, try running the script from the Script Editor. That way you can test values for variables at the bottom of the script to see what is happening. For instance put the variable foundList at the bottom of the script. If foundList is an empty list, then the regular expression needs to be fixed (the expression I gave you is looking for .png and .jpg files). Try the one that Manan gave you to get .ai and .eps files.

Shirley

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
Participant ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Hi Shirley,

Thanks for your reply. I have done as per your instruction that run from the script editor, nothing will happen.

And having some result at the bottom as shown below.

Screen Shot 2018-11-06 at 5.14.42 PM.png

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
Enthusiast ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

Hi again,

In response to your query that shows a screen shot of the Result in the AppleScript editor window.

This shows us two things:

1. The GREP is working, it found two text references:

characters 1 to character 5 of the story, and text from character 7 to character 11.

2. Placing the file is failing, it failed with two files:

files A.png and A.jpg in the graphics folder on the user's desktop.

If the files are not in a folder named "graphics" on your desktop, then you have a problem.

Here is a little test you can do to determine the problem. Put the following in a new script for the AppleScript Editor. Paste in the following:

set fileName to "A.jpg"

set userDesktop to path to desktop from user domain as string

set userFolder to "graphics"

set folderPath to userDesktop & userFolder

set filePath to folderPath & ":" & fileName

tell application "Adobe InDesign CC 2018"

  tell page 1 of document 1

  place file filePath

  end tell

end tell

Run it and check the result window. If it says the file can't be found, make sure the folder is named with a lower-case g and the file is in the folder--and the folder is on your desktop. If your files are elsewhere, you need to change the location in the script. Now you know how the Result window can help you to debug a script.

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
Participant ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Hi S. Hopkins,

Thank you very much for your reply. The script is running too good undoubtedly.

As you suggested that make a folder "graphics" on the desktop.

Screen Shot 2018-11-20 at 5.24.37 PM.png

Previous script:

--simple regEx expression will not work if spaces, hyphens or special characters allowed in filenames

set findStr to "\\b([A-Za-z0-9_-]+\\.eps|[0-9A-Za-z_-]+\\.ai|[0-9A-Za-z_-]+\\.png|[0-9A-Za-z_-]+\\.jpg|[0-9A-Za-z_-]+\\.gif)\\b"

--define path to folder of graphics

set fileDest to path to desktop from user domain as string

set folderDest to fileDest & "graphics"

tell application "Adobe InDesign CC 2018"

  --simple fine grep

  set find grep preferences to nothing

  set find what of find grep preferences to findStr

  --define find change grep options here

  tell find change grep options

  set include hidden layers to true

  set include locked layers for find to true

  end tell

  set docRef to document 1

  set theStory to story 1 of docRef

  tell theStory

  set foundList to find grep

  end tell

  set testList to {}

  if length of foundList > 0 then

  set find grep preferences to nothing

  set testList to {}

  with timeout of 300 seconds

  repeat with i from length of foundList to 1 by -1

  set thisItem to item i of foundList

  try

  set filePath to (folderDest & ":" & contents of thisItem)

  set fileRef to filePath as alias

  tell insertion point 1 of thisItem

  place fileRef

  end tell

  on error

  set end of testList to filePath

  end try

  end repeat

  end timeout

  --return to default

  set find grep preferences to nothing

  end if

end tell

{foundList, testList}

And the result is:

{{text from character 1 to character 5 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 7 to character 11 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 13 to character 17 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 19 to character 27 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 29 to character 48 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 50 to character 71 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 73 to character 88 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 90 to character 100 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 102 to character 107 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 109 to character 120 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 145 to character 158 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 160 to character 169 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 171 to character 183 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 185 to character 194 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 196 to character 208 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 210 to character 223 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 225 to character 248 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 250 to character 259 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 261 to character 273 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 275 to character 288 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 290 to character 303 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 305 to character 328 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 330 to character 339 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 341 to character 364 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 366 to character 375 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 377 to character 391 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 393 to character 402 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 404 to character 411 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 413 to character 425 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 427 to character 433 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 435 to character 469 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 471 to character 501 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 503 to character 513 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 515 to character 524 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 526 to character 535 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 537 to character 549 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 551 to character 569 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 571 to character 575 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 577 to character 583 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 585 to character 597 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 599 to character 630 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 659 to character 680 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 682 to character 699 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 716 to character 723 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 725 to character 742 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 744 to character 761 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 763 to character 777 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 779 to character 796 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 798 to character 824 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 826 to character 837 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 839 to character 858 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 860 to character 874 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 894 to character 905 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 925 to character 937 of story id 222 of document id 2 of application "Adobe InDesign CC 2018", text from character 989 to character 1002 of story id 222 of document id 2 of application "Adobe InDesign CC 2018"}, {"Macintosh HD:Users:amitg1:Desktop:graphics:diagnosis1.eps", "Macintosh HD:Users:amitg1:Desktop:graphics:diagnosis.eps", "Macintosh HD:Users:amitg1:Desktop:graphics:diagnosis.ai", "Macintosh HD:Users:amitg1:Desktop:graphics:copy.eps"}}

But some discrepancies discuss here as follow:

1. Do we add the space in the syntax line [A-Za-z0-9_-]+\\.eps because of some of the images containing the same as the screenshot below.

2. We want to delete the reference text after placing all the images.

Please suggest 2 above queries.

Really it is wonderful script to work with.

Regards,

Amit

Screen Shot 2018-11-20 at 5.21.42 PM.png

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 17, 2018 Nov 17, 2018

Copy link to clipboard

Copied

Have you considered using the Place Inline Images script by Kasyan Servetsky? I believe that will do what you are after. A link to a site describing the script is here: http://www.kasyan.ho.com.ua/indesign/image/place_inline_images.html

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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
Participant ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Thanks Colin for your response.

I have tried this script on InDesign CC2018 but did not happen anything after triggered the script.

Amit

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