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

setting resolutionFactor in script

Community Beginner ,
Apr 18, 2023 Apr 18, 2023

Copy link to clipboard

Copied

So I have a question with some seemingly conflicting information on the resolutionFactor property of a comp.

I can read the resolution factor without issue but I can't seem to set it even though the Scripting Guide seems to say it's a read/write property.

 

I've tried where this where, selection[i] is an app.project.selection and checked that the type is a comp:

 

 

selection[i].resolutionFactor = [1,1]
// and
selection[i].resolutionFactor[0] = 1
selection[i].resolutionFactor[1] = 1

 

 

Call_Me_Hoss_0-1681855640853.png

 

 
 
TOPICS
Scripting

Views

322

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

Community Expert , Apr 18, 2023 Apr 18, 2023

This worked for me:

app.project.selection[0].resolutionFactor = [1,1];

Votes

Translate

Translate
Community Expert ,
Apr 18, 2023 Apr 18, 2023

Copy link to clipboard

Copied

This worked for me:

app.project.selection[0].resolutionFactor = [1,1];

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 ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

LATEST

Thanks so much for confirming. It looks like it was totally my fault. I walked away for the evening and came at it with fresh eyes this morning and it works as it should.

 

I think it might have had something to do with a conflict between the installed script and ExtendScript in VSCode. I noticed I had two differing files and perhaps I was editing the wrong one🤦‍:male_sign:. Once that was cleaned up it works as I thought it should.

 

Thanks again.

 

Log.add("Before: " + selection[i].resolutionFactor.toString()); //Before: 4,4
selection[i].resolutionFactor = [1,1];
Log.add("After: " + selection[i].resolutionFactor.toString()); //After: 1,1

 

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