Coder Social home page Coder Social logo

Comments (6)

kgn avatar kgn commented on July 17, 2024 2

I'm also running into this with the following code:

var sketch = context.api()
var document = sketch.selectedDocument;
var selection = document.selectedLayers;

if (selection.isEmpty) {
    sketch.message("Nothing selected; nothing to export");
} else {
    selection.iterate(function(item) {
        log(item.name);
    });
}
TypeError: undefined is not an object (evaluating 'this._object._application.wrapObject')
line: 1627
sourceURL: /Applications/Sketch.app/Contents/Resources/SketchAPI.js
column: 54


Script executed in 0.025134s

from sketchapi.

kgn avatar kgn commented on July 17, 2024 2

This has been fixed in the develop branch

from sketchapi.

plrthink avatar plrthink commented on July 17, 2024

Also I'm new to Sketch plugin development, the docs on the http://developer.sketch.com really confuses me. Some parts says we should use cocoascript but the API section marks cocoascript version as deprecated.

I have learned that this pure JS version is WIP, so does it mean we should still using cocoascript nowadays and be recommended to using pure JS version in the future?

from sketchapi.

mattpfeffer avatar mattpfeffer commented on July 17, 2024

I was scratching my head over this one while trying to iterate over child layers on a page, should have just checked the issue log.

from sketchapi.

emilwidlund avatar emilwidlund commented on July 17, 2024

When does this fix reach the retail Sketch App?

from sketchapi.

plrthink avatar plrthink commented on July 17, 2024

I just tried the code in Sketch 41, it works except that name is not function, it's a property on layer object.

will close this.

from sketchapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.