Comments (1)
The API has been updated, but seems like the example didn't. Try this
var sketch = context.api()
log(sketch.api_version)
log(sketch.version)
log(sketch.build)
log(sketch.full_version)
var document = sketch.selectedDocument;
var selection = document.selectedLayers;
var page = document.selectedPage;
var group = page.newGroup({frame:new sketch.Rectangle(0, 0, 100, 100), name:"Test"});
var rect = group.newShape({frame:new sketch.Rectangle(10, 10, 80, 80)});
log(selection.isEmpty);
selection.iterate(function(item) { log(item.name); } );
selection.clear();
log(selection.isEmpty);
group.select();
rect.addToSelection;
sketch.getStringFromUser("Test", "default");
sketch.getSelectionFromUser("Test", ["One", "Two"], 1);
sketch.message("Hello mum!");
sketch.alert("Title", "message");
from sketchapi.
Related Issues (20)
- APIs missing: Set Fills opacity
- APIs missing: set Fills blending options
- APIs missing: a way to load the available pattern images.
- APIs missing: insert images in Fills HOT 1
- APIs missing: exporting Images HOT 1
- APIs Missing: Data supplier
- APIs missing: lines management
- APIs missing: flatten
- APIs missing: Outline HOT 1
- APIs missing: transform tool
- Error when calling getImportableTextStyleReferencesForDocument HOT 3
- MSForeignSymbolProvider.alloc().initWithDocument is not a function. HOT 1
- Error: 'libraryController.libraries' is undefined HOT 5
- The text has multiple text colors, How to know which fragment use which color variable ?
- No structure encoding found for CGRect HOT 2
- API missing for gradient : gradientStringWithMasterAlpha, what can be used to get the degree for a border in latest sketch
- absoluteInfluenceRect() removed in Sketch 96.X HOT 2
- Update for Sketch 97.2 HOT 2
- JS API equivalent for native API "multiplyBy" scaling
- how get a rotated layer frame info๏ผ
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sketchapi.