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

Need help diagnosing one line of code

Community Beginner ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

I and using javascript

I want to set a rectangular selection.

both of these throw an error and i can't figure why;

app.activeDocument.selection.select([3111.62,936.63,5300.89,4025]);

or

var coverRegion = [3111.62,936.63,5300.89,4025]

app.activeDocument.selection.select(coverRegion);

if I change this to crop it works though. According to the javascript reference guide it the same kind of array of coordinates (left, top, right bottom)

app.activeDocument.crop([3111.62,936.63,5300.89,4025]);

I have tested this as just a single line of code in it's own document and still get "Error 1220: Illegal Argument"

I'm pulling my hair out here.

TOPICS
Actions and scripting

Views

412

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

LEGEND , Feb 02, 2017 Feb 02, 2017

activeDocument.selection.select([[3111.62, 936.63], [5300.89, 936.63], [5300.89, 4025], [3111.62, 4025]])

Votes

Translate

Translate
Adobe
LEGEND ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

activeDocument.selection.select([[3111.62, 936.63], [5300.89, 936.63], [5300.89, 4025], [3111.62, 4025]])

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 Beginner ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

I just found the answer but this make s it m​uch more clear so thank you.

  1. activeDocument.selection.select([[3111.62, 936.63], [5300.89, 936.63], [5300.89, 4025], [3111.62, 4025]]) 

translated:

  1. activeDocument.selection.select([[LEFT, TOP], [RIGHT, TOP], [RIGHT, BOTTOM], [LEFT, BOTTOM]]) 

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
LEGEND ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

LATEST

function rec(l, t, r, b) {activeDocument.selection.select([[l, t], [r, t], [r, b], [l, b]])}

rec(3111.62, 936.63, 5300.89, 4025)

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