Last active
August 29, 2015 14:22
-
-
Save bomberstudios/fa0d5c299b09d65d9259 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move Right 100px (shift option →) | |
function areWeEditingText(){ | |
var currentLayer = context.selection[0] | |
if (currentLayer == null || currentLayer.isEditingText == undefined) { | |
return false | |
} else { | |
return currentLayer.isEditingText() | |
} | |
} | |
if(areWeEditingText()) { | |
// Do nothing, since we're editing text | |
} else { | |
// Move selected layer | |
var x = context.selection[0].frame().x() | |
context.selection[0].frame().setX(x + 100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately I couldn’t get that script to run or move anything. I changed the moving code a bit to the same stuff as Sketch Commands. Every time I try and run the plugin when I’m editing a text layer the Plugins dropdown flashes and nothing happens.
http://cl.ly/0b1H2d1n0p1a