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
//create the variables | |
var layerName = layer.name(); | |
var layerFrame = layer.absoluteRect(); | |
var layerXpos = String(layerFrame.x()); | |
var layerYpos = String(layerFrame.y()); | |
var layerHeight = String(layerFrame.height()); | |
var layerWidth = String(layerFrame.width()); |
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
//initialize the root xml element | |
var root = [NSXMLElement elementWithName:@"document"]; | |
//initialize the xml object with the root element | |
var xmlObj = [[NSXMLDocument document] initWithRootElement:root]; |
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
@import 'common.js' | |
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
//make sure something is selected | |
if(selection.count() == 0){ | |
doc.showMessage("Please select a layer."); | |
}else{ |
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
//create variable to check if clicked | |
var clicked = [panel runModal]; | |
//check if clicked | |
if (clicked == NSFileHandlingPanelOKButton) { | |
var isDirectory = true; | |
//get the folder path | |
var firstURL = [[panel URLs] objectAtIndex:0]; | |
//format it to a string | |
var file_path = [NSString stringWithFormat:@"%@", firstURL]; |
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
//allow xml to be written to the folder | |
var fileTypes = [NSArray arrayWithObjects:@"xml", nil]; | |
//create select folder window | |
var panel = [NSOpenPanel openPanel]; | |
[panel setCanChooseDirectories:true]; | |
[panel setCanCreateDirectories:true]; | |
[panel setAllowedFileTypes:fileTypes]; |
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
@import 'common.js' | |
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
//make sure something is selected | |
if(selection.count() == 0){ | |
doc.showMessage("Please select a layer."); | |
}else{ |
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
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
if(selection.count() == 0){ | |
doc.showMessage("Please select something."); | |
}else{ | |
for(var i = 0; i < selection.count(); i++){ | |
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
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
if(selection.count() == 0){ | |
doc.showMessage("Please select something."); | |
}else{ | |
for(var i = 0; i < selection.count(); i++){ | |
var layer = selection[i]; |
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
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
if(selection.count() == 0){ | |
doc.showMessage("Please select something."); | |
}else{ | |
for(var i = 0; i < selection.count(); i++){ | |
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
var onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
if(selection.count() == 0){ | |
doc.showMessage("Please select something."); | |
}else{ | |
for(var i = 0; i < selection.count(); i++){ | |
var layer = selection[i]; |