function selectLinesByColor(color, options) { options = options || {}; if (color !== 'transparent') { if (_.isString(color) && color.indexOf('#') !== 0) color = '#' + color; if (_.isString(color) && !parseInt(color.substring(1), 16)) { log(color + ' is not a valid color'); return []; } else if (!_.isNumber(color)) { log (color + ' is not a number'); return []; } } return filterObjs(function(obj) { var colorMatch, hue, hueMatch; if (obj.get('type') !== 'path') return false; if (options.layer && obj.get('layer') !== options.layer) return false; if (options.pages && options.pages.length > 0 && !_.contains(options.pages, obj.get('pageid'))) return false; colorMatch = options.matchFill ? obj.get('fill') : obj.get('stroke'); if (options.epsilon && color !== 'transparent') { if (colorMatch === 'transparent') return false; hue = rgbToHsv(parseInt(color.substring(1), 16)).hue; hueMatch = rgbToHsv(parseInt(colorMatch.substring(1), 16)).hue; return Math.abs(hue - hueMatch) <= options.epsilon; } else { return colorMatch === color; } }); } function rgbToHsv(rgb) { var r = (rgb >> 16) / 255, g = ((rgb >> 8) & 255) / 255, b = (rgb & 255) / 255, max = Math.max(r, g, b), min = Math.min(r, g, b), h, s, l = (max + min) / 2, d; if (max === min) { h = s = 0; } else { d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { hue: h, saturation: s, value: v }; } The selectLinesByColor function will return a list of Path objects which you can manipulate with more API code, such as setting their top and left properties to move them, or setting their layer property to switch their layer. There is no means in the API to actually select an object such that you can then manipulate the group of selected objects with your cursor. The above code accepts a color , which may be the string "transparent", a string hex value with or without a leading hash (#), or an integer. It also accepts an optional options object, which can let you specify a specific layer to search (with the string options.layer ; if omitted, all layers will be searched), specific pages to search (with the array of strings options.pages ; if omitted or an empty array, all pages will be searched), whether to match the fill color instead of the stroke color (with the boolean options.matchFill ; if false or omitted, the stroke color will be matched against), and whether to match paths that are close in color (with the number options.epsilon ; if given a value, the difference in the hues of the colors will be compared. The hue values will be in the [0..1] range, so any epsilon value at 1 or greater would match all paths, regardless of the supplied color , and any epsilon value less than 0 will match no paths. An epsilon of exactly zero will match paths with identical hues only, but they may have different saturations or values.) Disclaimer: The above code has not been tested.