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

Script to select a reference point?

Explorer ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

Hi all,

Longtime lurker, first time poster.

I'm looking for a simple script that selects a reference point. You'd be the best person on the internet today if you'll also tell me where to edit it, so I can make another script, to select another reference point. I'll then use the scripts in some actions.

Thanks so much!

Adam

TOPICS
Scripting

Views

1.7K

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 1 Correct answer

Contributor , Sep 12, 2018 Sep 12, 2018

Have you tried setting the reference point as part of your action?

I am on a Mac, and it works for me.

Votes

Translate

Translate
Adobe
Community Expert ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

… and what to do?

For the beginning: Script to set reference point

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 ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

It’s pretty pedestrian. Moving a placed image into a precise position. My workflow gets all messed up when I start an action that involves moving objects around, and they move into the wrong position because the refern point was wrong.

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 ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

Please describe your workflow in detail. (Did you know you can move objects through scripting?)

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 ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

Here's the gist of two actions I'm most interested in using this for. I'm away from work now, so pardon if that this is what I can recreate from memory. The parts of the action this script would be helpful for are in bold:

Rasterized/fully flattened PDF to client:

  1. Select all on active artboard.
  2. Copy.
  3. Create new layer.
  4. Paste in place into new layer.
  5. Hide all other layers.
  6. Export as PNG.*
  7. Place the PNG.
  8. Align the PNG on the artboard.
  9. Save a copy/PDF.

*I use a similar action which uses the Rasterize command instead, but for reasons beyond me, it frequently (and inconsistently) produces a PDF with huge portions of the art missing.

Aligner/Duplicator:

  1. Align a compound path on the artboard.
  2. Move and duplicate it.
  3. Move and duplicate the duplicate.

Neither of these are life-and-death, but having one less possibility for something to go wrong, or one less thing to think about, would really smooth my day.

Thanks!

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 ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

Place a file:

How can I place image into an .ai file using java?

calculate the middle of width and height of the placed item

calculate the middle of width and height of the artboard

use position property of the placed item to set the new (top and left) position

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 ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

I'm so sorry, I should have been clear at the top: I don't know how to code. I'm specifically asking for a very kind person to write me some Javascript. Thank you again!

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 ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

can you show screen shots showing before and after? I'd like to see what kind of alignment you need

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 ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

Thanks for your willingness to help, Carlos. I stared at the screen for a while today, unsure how to represent what I want to do with screenshots, and then Mike pointed out I don't need a script at all. So no need.

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 ,
Sep 14, 2018 Sep 14, 2018

Copy link to clipboard

Copied

LATEST

no problem, glad to hear you were helped.

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
Contributor ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

Have you tried setting the reference point as part of your action?

I am on a Mac, and it works for me.

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 ,
Sep 12, 2018 Sep 12, 2018

Copy link to clipboard

Copied

Hey Mike,

I'm amazed—because I thought I'd tried that at the start, and I didn't remember it working—but setting the reference point in the Transform panel did the trick. Thanks for encouraging me to go back to basics!

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
Contributor ,
Sep 13, 2018 Sep 13, 2018

Copy link to clipboard

Copied

Glad to be of help, Stopped Down.

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