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

Script for Proofing Template

Explorer ,
Nov 28, 2016 Nov 28, 2016

Copy link to clipboard

Copied

Was wondering if it would be possible to create a Script that would take a Selection or image and re-size it proportionally into an 11"w x 8.5" H document and place it Centered in a 10.5" x 6" box located at the top of the page. If possible if it can detect the size as being less than 10.5" x 6" then don't scale, but if larger scale down to fit Proportionately.... Then Provide a dialog box that would let me enter my job # and today's date in a pre-determined location. I've attached a sample of what I'm trying to accomplish for the finished look. I'm also Assuming the base elements will need to reference a file (or template) that would contain the proofing information if so we'll call it "Proof_Temp.ai"

Huge thanks in advance for anyone that can assist...

Proof Sample.jpg

TOPICS
Scripting

Views

3.3K

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 Expert ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

assuming what you just pasted in is the exact code you're running, here are the issues.

You are running this command twice:

app.open(theFile).

Delete the second one.

on this line:

var theImg = docRef.pageItems[0];

the syntax is perfect, but you haven't defined "docRef". This line is going to fail because "docRef" is undefined.

Then the last line you posted:

artboards[0].artboardRect = [0,0,docSize[0],-(docSize[1])]

the variable "artboards" is undefined. this line will also give you an error.

here's how your snippet should look to do the basic task you're asking for:

var theFile = File('~/Desktop/Proof Sample.jpg');

app.open(theFile);

//set artboard size to image size

var docRef = app.activeDocument;

var artboards = docRef.artboards;

var theImg = docRef.pageItems[0];

theImg.left = 0;

theImg.top = 0;

artboards[0].artboardRect = [0,0,theImg.width,-(theImg.height)]

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 ,
Dec 13, 2016 Dec 13, 2016

Copy link to clipboard

Copied

I have finally managed to complete this task and it's wonderful... No I'm in the process of tweaking it to add additional functionality...

Thanks to so many for all your help....

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 ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

Hi read this and was wondering if it works? We do similar work but would like to create this in InDesign and with dimensions of image etc mentioned in inches.

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 ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

LATEST

I need something similar to allow my non-illustrator employees to produce proofs easily. I would be happy to hire someone to do this. Please contact me [Removed Email address by Moderator].

 

Please, Do not write any private information in public 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