bomberstudios / sketch-commands Goto Github PK
View Code? Open in Web Editor NEWA collection of script commands for Sketch.app
A collection of script commands for Sketch.app
I'm unable to save artboards to anywhere than iCloud.
It sets the value correctly but Sketch doesn't render the changes until the radius slider is dragged upon.
Hey there,
first of all thanks a lot for providing these very useful commands for Sketch!
Very helpful in our everyday work.
I have something in my mind since quite some time that I think would totally enhance our workflow. It might be pretty specific, and the solution I have in mind not really possible with Sketch's current API, but I thought I just write it down here to start a conversation …
We're working with a lot of Artboards per Page. This happens both while exploring a broad range of drafts (duplicating Artboards for new iterations), but also when documenting our design. We're taking some time to refactor our documents every now and then – mostly manually order the Artboards on the Canvas from the upper left to the lower right.
Now the problem: we usually have a pretty well structured Canvas, upper left to lower right. But this –for sure– is not at all reflected in the Layer List (new/duplicated Artboards being added on top of currently selected Artboard -> layer model). So I was thinking if we have this clear order of Artboards on the Canvas, wouldn't it be great to have a command to re-order the Artboards representations in the Layer List accordingly? (First Artboard top left becomes first in the Layer List etc.)
(Also, it would be great to be able to expand/collapse all Artboards/Groups in the Layer List at once by pressing a modifier, just like in Photoshop – but I'm aware this is something that should be part of Sketch itself ;-)
Do you know what I mean? Looking forward to your thoughts!
Have a great Sunday,
Christophe
As per our Twitter discussion: https://twitter.com/zilmer/status/433889032469487616
Thanks in advance.
Using the file dialog in ways such as this:
[doc askForUserInput:"Export to…" ofType:2 initialValue:file_path]
can return paths that start with file://
, which is not acceptable for the com.bomberstudios.export_all_*
functions.
This was observed on OSX 10.9.4, Sketch Version 3.0.4 (8053) and specifically for folders on the Desktop.
This should probably handled in a standard way.
All the Clear Guides on Page (All, Vertical and Horizontal) don't seem to work for me. I tried a few different setups (multiple art boards, selected, un-selected, etc) but it never seems to work.
Error at like 26
Would it be possible to create a command that would take any selected object and create an artboard from it?
Latest version of Sketch beta and the Commands happen to crash the app.
Running Mavericks.
Sometimes, locked layers are in nested groups, which are so hard to find.
Can I request this feature here?
Plugin doesn't seem to be working after updating to Yosemite. Maybe its just me, not sure though.
Getting this in console.app "10/23/14 12:16:52.207 AM All Slices as PDF (Sketch Plugin)[406]: AppSandboxFileAccessPersist.keyForBookmarkDataForURL(file:///Users/colemantharp/Dropbox/Projects/Coleman%20Tharp/PROJECT/iOS/)" when trying to export all artboards as PNG.
Is there anyway to fix this?
In other words, it doesn't work when you select layers that are grouped and ungrouped at the same time.
When using this tool, it doesn't seem to do anything. Same goes for "Export All Artboards as png"
The only ones that seem to work are "Selection to ..." and "Whole Page ..."
OSX El Capitan
V10.11.3
Sketch
V3.5.1 (25234)
The option+shift+arrow
default shortcut interferes with the OS-level text-selection shortcut. option+shift+arrow[left/right]
selects the word to the right or left of the cursor. I use this a lot when renaming layers and artboards.
The default Sketch Commands shortcut interferes with this and it’s pretty annoying. I can imagine other people have this problem too.
It would be nice to have commands to add / remove numbers in Artboard / Page / Slice (even Layer) names.
This is requested on #18, see there for more context.
Could there be some sort of script that took all your current layers within a slice and exported at least the png version into a PSD organised correctly with their position and size? Layer styles would be an awesome plus but I'm not even sure if any sort of program could have permissions to export to psd.
Thanks guys!
Copies the guides from the current page.
Sketch 2.4.2 on Mountain Lion crashes when I'm trying to use the plugin. Properly installed. Other plugins work.
Right now we take the max dimension of the two elements selected. Any thoughts of also allowing min dimension?
Moving commands don't work after 3.4 sketch update.
Update: As it turned out, sketch 3.4 works tricky with selection
variable if several sketch files are opened
Inspired by this repo, I'm creating my own commands and most of them have been borrowed from yours so, if you're interested, I can create a PR to update this repo structure. Some of these changes would be:
.jstalk
by .cocoascript
.sketchplugin
foldermanifest.json
filemanifest.json
when new files are added or updated into the sketch plugin folderCreate a command that will select all art boards in a page for the purpose of re-alining with the grid tool.
Hi,
can I give my generated guides an new position?
And can I delete some of them or only all of my artboard?
BR
Hi,
no export does not work with my version 2.2.4 (242), purchased on App store
Thx
All artboards are set correctly but when i click 'export' it does see 21 out of 29 artboards to select.
I'm not sure if i'm doing something wrong at this point. Is there a limit to artboards to be exported?
Most, if not all, of the sketch commands plugins aren't working in the latest Sketch 2.3 beta (3898). There may be some underlying changes made to Scripting in 2.3, but I don't see documentation for any changes, yet.
Love this command, would love it more it I could set the distance between the items.
Reported by @mrrocks
Looking to see if you can take a layer and create an artboard from it?
Thx
Hi, is it possible to script shortcuts for going to the next page / previous page and opening the drawer of pages?
I could have sworn earlier versions of Sketch had shortcuts for these but I haven't been able to find anything about that. Navigating between pages is my main point of frustration with Sketch right now.
The current plugin for All Artboards In Page does deselect everthing in the current page before selecting all artboards. However it keeps the selected layers in other Pages in the same document.
I use the plugin to select all artboards in this page for exporting to a particular folder for the page.
Thanks in advance ;)
I was wondering if there could be a command that exports all artboards for all pages at once. Also it should make sure that it renames the export so that similarly named artboards don't get crushed on export.
Thx!
I'm working on a document with 40 artboards.
When using any of the export commands, Sketch crashes. I've seen there might be some problems when files aren't saved but mine is.
Thanx!
Ester
Seing how difficult it is to manually remove guides, a collection of command to remove All / Vertical / Horizontal guides would be most welcome.
Not quite sure why - tested on a small project and it worked fine.
With one of my larger projects Sketch bombs - here's the log from my console. The marker in the log was added just prior to executing the command so everything after is a result of running the script.
25/10/2014 22:03:15.181 Console[29277]: Marker - 25 Oct 2014 22:03:15
25/10/2014 22:03:30.207 Sketch[29581]: 1 0x7fff848a07f6 cti_op_call_NotJSFunction
25/10/2014 22:03:30.207 Sketch[29581]: 2 0x472d566121a9
25/10/2014 22:03:30.207 Sketch[29581]: 3 0x7fff84720ba6 JSC::Interpreter::execute(JSC::ProgramExecutable_, JSC::ExecState_, JSC::JSObject_)
25/10/2014 22:03:30.208 Sketch[29581]: 4 0x7fff8471f9a6 JSC::evaluate(JSC::ExecState_, JSC::SourceCode const&, JSC::JSValue, JSC::JSValue_)
25/10/2014 22:03:30.208 Sketch[29581]: 5 0x7fff8471f69d JSEvaluateScript
25/10/2014 22:03:30.208 Sketch[29581]: 6 0x10d2d0725 -[Mocha evalJSString:scriptPath:]
25/10/2014 22:03:30.208 Sketch[29581]: 7 0x10d2d0639 -[Mocha evalString:atURL:]
25/10/2014 22:03:30.208 Sketch[29581]: 8 0x10d2d4848 -[COScript executeString:baseURL:]
25/10/2014 22:03:30.208 Sketch[29581]: 9 0x10ceec0df
25/10/2014 22:03:30.208 Sketch[29581]: 10 0x10ce5ad8a
25/10/2014 22:03:30.208 Sketch[29581]: 11 0x10ce59e3d
25/10/2014 22:03:30.209 Sketch[29581]: 12 0x7fff8b78a260 -[NSApplication sendAction:to:from:]
25/10/2014 22:03:30.209 Sketch[29581]: 13 0x7fff8b7a51c8 -[NSMenuItem corePerformAction]
25/10/2014 22:03:30.209 Sketch[29581]: 14 0x7fff8b7a4f04 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:]
25/10/2014 22:03:30.209 Sketch[29581]: 15 0x7fff8b7f440d -[NSMenu internalPerformActionForItemAtIndex:]
25/10/2014 22:03:30.210 Sketch[29581]: 16 0x7fff8b7f4289 -[NSCarbonMenuImpl carbonCommandProcessEvent:handlerCallRef:]
25/10/2014 22:03:30.210 Sketch[29581]: 17 0x7fff8b79aff6 NSSLMMenuEventHandler
25/10/2014 22:03:30.210 Sketch[29581]: 18 0x7fff84fa91d4 DispatchEventToHandlers(EventTargetRec, OpaqueEventRef, HandlerCallRec)
25/10/2014 22:03:30.210 Sketch[29581]: 19 0x7fff84fa8787 SendEventToEventTargetInternal(OpaqueEventRef_, OpaqueEventTargetRef_, HandlerCallRec_)
25/10/2014 22:03:30.210 Sketch[29581]: 20 0x7fff84fbc880 SendEventToEventTarget
25/10/2014 22:03:30.210 Sketch[29581]: 21 0x7fff84ff2640 SendHICommandEvent(unsigned int, HICommand const_, unsigned int, unsigned int, unsigned char, void const_, OpaqueEventTargetRef_, OpaqueEventTargetRef_, OpaqueEventRef__)
25/10/2014 22:03:30.211 Sketch[29581]: 22 0x7fff85025228 SendMenuCommandWithContextAndModifiers
25/10/2014 22:03:30.211 Sketch[29581]: 23 0x7fff850251d0 SendMenuItemSelectedEvent
25/10/2014 22:03:30.211 Sketch[29581]: 24 0x7fff850250af FinishMenuSelection(SelectionData_, MenuResult_, MenuResult_)
25/10/2014 22:03:30.211 Sketch[29581]: 25 0x7fff8502d085 MenuSelectCore(MenuData_, Point, double, unsigned int, OpaqueMenuRef__, unsigned short_)
25/10/2014 22:03:30.211 Sketch[29581]: 26 0x7fff8502ccb1 _HandleMenuSelection2
25/10/2014 22:03:30.211 Sketch[29581]: 27 0x7fff8b70d62c _NSHandleCarbonMenuEvent
25/10/2014 22:03:30.212 Sketch[29581]: 28 0x7fff8b56c52e _DPSNextEvent
25/10/2014 22:03:30.212 Sketch[29581]: 29 0x7fff8b56b89b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
25/10/2014 22:03:30.212 Sketch[29581]: 30 0x7fff8b55f99c -[NSApplication run]
25/10/2014 22:03:30.212 Sketch[29581]: 31 0x7fff8b54a783 NSApplicationMain
25/10/2014 22:03:31.378 _securityagent[29628]: audit warning: allsoft
25/10/2014 22:03:31.378 _securityagent[29627]: audit warning: soft /var/audit
25/10/2014 22:03:31.380 _securityagent[29629]: audit warning: closefile /var/audit/20141025210259.20141025210331
25/10/2014 22:03:31.497 com.apple.launchd.peruser.505[191]: (com.bohemiancoding.sketch3.6016[29581]) Job appears to have crashed: Segmentation fault: 11
25/10/2014 22:03:31.712 ReportCrash[29623]: Saved crash report for Sketch[29581] version 3.1 (8751) to /Users/xxxxxxxx/Library/Logs/DiagnosticReports/Sketch_2014-10-25-220331_xxxxxxxxxxx-MacBook-Pro.crash
A-la Sketch Framer : )
Could be usefull for embedding icons inline on CSS files
Hi there,
Here's a common issue. The Sketch guys still haven't figured out a good way to synchronize the canvas position across all pages, which means when you want to present your work or look at it to compare screens, the canvas jumps all over the place, rendering it unusable.
I was wondering if there was a way to align all the pages in one command. Right now, I have to do: (page down + center canvas + 100% actual size) x the number of pages. Which is super annoying, especially because I have to do it as soon as I move the canvases around.
Cycling through pages and centering and resizing would be awesome. I tried looking into scripting myself but I'm having trouble understanding it.
All the plugins that use the common.js library seem to not work unless you save the file first.
The reported error in the console is Sketch[55304:707] JSException: TypeError: 'null' is not an object (evaluating 'file_url. path') on line 9 of (null)
Using the Fix Position commands without doing anything else crashes the app.
Here's the log for that http://cl.ly/Tkke
Both plugins don't seem to work, the create new one does.
Hi. I'm sorry if this has been asked before, but is it possible to export all the artboards in the current page as a single file, the way they are presented on the screen?
Say, when I want to show all the artboard on a single page to a client. Is it possible at all?
This use to create folders for each Page that the document had. It's not working for me anymore. I'm able to export the artboard from the current Page but doesn't create the folders like it use to.
Would it be possible to enhance this command by creating a folder (on export) for each page in the Sketch document?
Right now if you have the same name within different pages the exports get overwritten by each other. Hope that makes sense.
Hi,
Love this plugin but I can't seem to export to @2x PNG any tricks on how I can edit this plugin to do this?
Thanks,
Mario
Say, running the command normally overwrites the file, and running it while pressing the "Alt" key creates a new version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.