Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Need to save the page by the placed image name

New Here ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

Hi

I have a bunch of images I need to resize in on indesign, but want to save the images by the image name that is embedded on the page. I've tried some scripts that have left errors and I've tried the sample catalogue script that doesn't do anything at all. Im at a loss please help me.

 

Thank you 

TOPICS
Scripting

Views

98

Likes

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 ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

Hi, can you clarify? So you have an Indesign document that has a single placed image, and you want to save-as that indesign document as the name of the placed image? eg. if the placed image is "my image.jpeg", the script should save-as the document as "my image.indd"? Also, where should it save the document?

Likes

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 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Exactly.  ie The name of the image is Purplet-shirt $20.00, it has been sized to a social media size needs to be saved The Purplet-shirt $20.00.

I am resizing catalogue images to social media size, the images are named specifically. I have impoted all of them, now need to save them by the same origional name as jpegs.

Thank you 

 

 

Likes

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
Adobe Community Professional ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

 it has been sized to a social media size needs to be saved The Purplet-shirt $20.00.

 

For social media you must need a specific pixel dimension. Why not batch that in Photoshop?

Likes

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
Advocate ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

hello @defaultgckpsw4387fx \ @Morgan5C5D 

 

The below script will export each page within the Indesign document as a jpeg named by the same origional placed jpeg name. The jpegs are exported to a folder on the desktop named jpgs, you'll need to create the jpgs folder on your desktop before hand. You will also need to set the export settings to your specific needs.

 

 

var aDoc = app.activeDocument;
var docPages = aDoc.pages;

for(p=0;p<docPages.length;p++){

var myPageItems = docPages[p].allPageItems
var myPageName = docPages[p].name;

for(i=0;i<myPageItems.length;i++){

//set selection as variable
var thisItem = myPageItems[i];
if(thisItem instanceof Rectangle || thisItem instanceof Polygon || thisItem instanceof Oval){

//get image within the frame
var myLinkedItem = thisItem.pageItems[0];
//get name of the linked image
var myLinkName = myLinkedItem.itemLink.name;

//strip extension from linked image name
var myLinkName = myLinkName.split('.')[0];

app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.maximum; // low medium high maximum
app.jpegExportPreferences.exportResolution = 300;
app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
app.jpegExportPreferences.pageString = myPageName;

//Set Name of exported pdf to match the name of the linked image
var myFile = File('~/Desktop/jpgs/' + myLinkName + '.jpg');

//export the JPG
aDoc.exportFile(ExportFormat.JPG, myFile, false);
  }
 }
}

 

 

 

Regards,

Mike

Likes

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
Adobe Community Professional ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Hi Mike, if sizing for social media images is done with InDesign’s Pixel Units, the exportResolution would have to be 72ppi to get a matching exported JPEG pixel dimensions. This image’s parent frame is 500 x 350 pixels, and 72ppi will export it to the same pixel dimensions.

 

Screen Shot.png

 

Likes

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
Advocate ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Hello @rob day 

 

Thanks for pointing out the exportResolution would have to be 72ppi...

 

That's why I stated in my post: "You will also need to set the export settings to your specific needs."

 

Regards,

Mike

Likes

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
Adobe Community Professional ,
Jul 24, 2021 Jul 24, 2021

Copy link to clipboard

Copied

LATEST

Sorry, I missed that.

Likes

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