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

Extendscript: Creating empty path, selecting it, then drawing with the pen tool, is inverted on Mac.

New Here ,
Mar 12, 2024 Mar 12, 2024

Copy link to clipboard

Copied

This is a very, very niche issue, so bear with me. (Code at the bottom)

 

I've got a script that creates an empty Shape Layer, adds an empty Path to it, selects the path, then switches the tool to the Pen Tool.

Essentially, it quickly lets the user start drawing with the Pen Tool. (In more detail; it lets me control everything about the Shape Layer before the user starts drawing, from other properties . Not important, but I know people prefer a little bit more context).

 

The issue is: On a MAC (I think), the first click and drag of the pen tool goes in the opposite direction. (Basically, the In Tangent and Out Tangent is swapped, on the first vertex only).

Then every click after that is correct. This doesn't seem to happen on Windows, though I don't have enough computers/people to verify this.

 

This definitely seems to be a bug, as the more I fiddle with this, the more random behaviours that appear. But I wanted to ask if people have dealt with this issue?

 

Ultimately, I can (kind of) work around it. If I check if the OS is a Mac, then I can correct for this. However, if this isn't a mac/windows issue, I'd like a more local, guaranteed way to detect (via scripting) if this issue exists.


The code:

app.beginUndoGroup("Path Error")
var targetShapeLayer = app.project.activeItem.layers.addShape();
var targetPath = targetShapeLayer.property("Contents").addProperty("ADBE Vector Shape - Group")
    targetPath.selected = true;
    app.project.toolType = ToolType.Tool_Pen;
app.endUndoGroup();

 

With that code, I kept clicking and dragging downwards (out tangent pointing toward the bottom). But for some reason, the first vertex draws incorrectly:

Screenshot 2024-03-13 at 10.33.53 am.png

TOPICS
Scripting

Views

100

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 ,
Mar 12, 2024 Mar 12, 2024

Copy link to clipboard

Copied

LATEST

Seems to work as expected for me, on Win 11.

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