Skip to content

Commit 02d536e

Browse files
Merge pull request #7 from bastienEichenberger/development-branch
Development branch
2 parents 7adf281 + 50f0470 commit 02d536e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2827
-8
lines changed

lib/photoshop/document/resize.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*/
88
PS.Document.Resize = (function (my) {
99

10-
10+
1111
/**
1212
* Function to resize an image in Photoshop
1313
* @function resampling
1414
* @memberOf PS.Document.Resize
1515
* @param {Object} options
1616
* @param {number} options.resolution, the resolution in pixcel per inch
17-
* @param {ResampleMethod} options.resample_method [ResampleMethod.BICUBIC, ResampleMethod.BICUBICSHARPER,
17+
* @param {String} options.resample_method [ResampleMethod.BICUBIC, ResampleMethod.BICUBICSHARPER,
1818
* ResampleMethod.BICUBICSMOOTHER,ResampleMethod.BILINEAR, ResampleMethod.NEARESTNEIGHBOR, ResampleMethod.NONE]
1919
* @param {number} options.horizontal_scale
2020
* @param {number} options.vertical_scale
@@ -29,12 +29,15 @@ PS.Document.Resize = (function (my) {
2929
*/
3030
my.resampling = function (options, document) {
3131

32-
var width, height;
32+
var width, height, options;
33+
34+
// transtype the resample method string to an object ResampleMethod.MyMethod
35+
options.resample_method = eval(options.resample_method);
3336

3437
if (document === undefined) {
3538
var document = app.activeDocument;
3639
}
37-
40+
3841
if (options.resample_method !== ResampleMethod.NONE) {
3942

4043
if (!options.horizontal_scale || !options.vertical_scale) {
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/**
2+
* This script allow you to import a layer into an other InDesign document
3+
* @author Bastien Eichenberger
4+
* @supported Mac OS X InDesign (versions 7-11 CS5 to CC)
5+
*/
6+
7+
8+
//@include "../dependencies/extendscript-library/lib/indesign/indesign-lib.jsx"
9+
10+
11+
try {
12+
13+
14+
/***********************************************
15+
* CONSTANTS
16+
***********************************************/
17+
18+
/**
19+
* @type {Object}
20+
* @property {Folder} FOLDER_SCRIPT
21+
* @property {Folder} FOLDER_LOG
22+
* @property {Folder} FOLDER_DATA
23+
* @property {Folder} FOLDER_OUTPUT
24+
*/
25+
var CONSTANTS = {};
26+
27+
CONSTANTS.VERSION = 2.0;
28+
CONSTANTS.FOLDER_SCRIPT = new File($.fileName).parent;
29+
CONSTANTS.FOLDER_LOG = new Folder(CONSTANTS.FOLDER_SCRIPT + '/log');
30+
31+
/***********************************************
32+
* INIT THE SCRIPT
33+
***********************************************/
34+
35+
// init the library config
36+
IN.Config.init();
37+
38+
// set the logger to debug
39+
H.Log.init(CONSTANTS.FOLDER_LOG, 0);
40+
41+
if ($.locale === 'fr_FR') {
42+
//@include "includes/translations/FR.jsx"
43+
}
44+
else {
45+
//@include "includes/translations/EN.jsx"
46+
}
47+
48+
//@include "includes/mainController.jsx"
49+
//@include "includes/mainView.jsx"
50+
51+
if (app.documents.length === 0 || app.documents.length > 1) {
52+
alert('Please open the source document before you run this script');
53+
exit();
54+
}
55+
56+
/***********************************************
57+
* GLOBALS
58+
***********************************************/
59+
60+
61+
/***********************************************
62+
* Controller
63+
***********************************************/
64+
65+
var view = mainView();
66+
67+
// generate the controller
68+
var controller = mainController(view);
69+
70+
// display the UI
71+
if (view.ui.show() === 1) {
72+
73+
controller.run();
74+
75+
alert('script finished');
76+
}
77+
else {
78+
alert('The Script have been forced to cancel');
79+
exit();
80+
}
81+
82+
83+
}
84+
catch (ex) {
85+
86+
var error_message = 'file: ' + ex.fileName +
87+
'\n name: ' + ex.name +
88+
'\n message: ' + ex.message +
89+
'\n line: ' + ex.line;
90+
91+
H.Log.error(error_message);
92+
alert(error_message);
93+
94+
}
95+
finally {
96+
IN.Application.restore();
97+
}
Binary file not shown.

public-scripts/ImportLayers/app/includes/mainView.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** * Function to build the view * @return {Object} the view object with all ui elements */var mainView = function () { /*********************************************** * Public ***********************************************/ var that = {}; that.ui = new UI(TRANS.VIEW.TITLE.printf(CONSTANTS.VERSION.toString()), { alignChildren: 'left', resizeable: true } ); // pans that.pans = {}; that.row = that.ui.group('row', {orientation: 'row', alignChildren: 'top'}); that.column_left = that.row.group('row', {orientation: 'column', alignChildren: 'left'}); that.pans.layers = that.column_left.panel(TRANS.VIEW.LAYERS, { orientation: 'column', alignChildren: 'left' }); that.pans.items = that.column_left.panel(TRANS.VIEW.ITEMS, {orientation: 'column'}); that.pans.target = that.column_left.panel(TRANS.VIEW.TARGETS, { orientation: 'column' }); // groups that.grps = {}; that.grps.items_1 = that.pans.items.group('actions', { orientation: 'column', alignChildren: 'left', alignment: ['left', 'center'] }); that.grps.target = that.pans.target.group(TRANS.VIEW.TARGETS, { orientation: 'row', alignChildren: 'left', alignment: ['left', 'center'], size: [600, 50] }); that.grps.nav = that.ui.group('nav', {orientation: 'row', alignment: 'right'}); that.items_textframes = that.grps.items_1.add('checkbox', 'Textframes'); that.items_graphics = that.grps.items_1.add('checkbox', 'Graphics'); that.items_others = that.grps.items_1.add('checkbox', 'Others'); // controls target that.target_add = that.grps.target.add('button', TRANS.VIEW.BTN_TARGET); that.target_path = that.grps.target.add('statictext', TRANS.VIEW.BTN_TARGET_PLACEHOLDER, undefined, {size: [600, 50]}); // nav that.stop = that.grps.nav.add('button', 'stop', undefined, {name: 'cancel'}); that.run = that.grps.nav.add('button', TRANS.VIEW.RUN, undefined, {name: 'ok'}); return that;}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var TRANS = {
2+
3+
INIT: {
4+
SUPPORT: "This script works on Photoshop 13.0 (CS6) \n" +
5+
"Install the correct version and try again",
6+
CANCEL: "The Script has been forced to cancel",
7+
OPEN: "Please close all documents"
8+
},
9+
10+
VIEW: {
11+
TITLE: "ImportLayers / version %s",
12+
LAYERS: "Layers to import",
13+
ITEMS: "Items to import",
14+
TARGETS: "Targets",
15+
BTN_TARGET: "add document",
16+
BTN_TARGET_PLACEHOLDER: "Please select the target document",
17+
RUN: "Go"
18+
},
19+
20+
CONTROLLER: {
21+
REPORT_HEADER: "ImportLayer Report ------- %s",
22+
FINISHED: "script finished",
23+
EMPTY_DOC: "The form is not valid. Please add a target document",
24+
}
25+
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var TRANS = {
2+
3+
INIT: {
4+
SUPPORT: "Ce script fonctionne sur InDesign 13.0 (CS6) ou supérieur \n" +
5+
"Installer une autre version et réessayer",
6+
CANCEL: "Le script a été forcé a quitté",
7+
OPEN: "Please close all documents"
8+
},
9+
10+
VIEW: {
11+
TITLE: "ImportLayers / version %s",
12+
LAYERS: "Layers to import",
13+
ITEMS: "Items to import",
14+
TARGETS: "Targets",
15+
BTN_TARGET: "add document",
16+
BTN_TARGET_PLACEHOLDER: "Please select the target document",
17+
RUN: "Go"
18+
},
19+
20+
CONTROLLER: {
21+
REPORT_HEADER: "ImportLayer Report ------- %s",
22+
FINISHED: "script finished",
23+
EMPTY_DOC: "The form is not valid. Please add a target document",
24+
}
25+
26+
}

public-scripts/ImportLayers/app/log/log.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Mon Jul 03 2017 15:06:20 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainView.jsx name: TypeError message: undefined is not an object line: 38Mon Jul 03 2017 15:10:35 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainView.jsx name: TypeError message: undefined is not an object line: 46Mon Jul 03 2017 15:10:50 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainView.jsx name: TypeError message: undefined is not an object line: 50Mon Jul 03 2017 15:11:13 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 724Mon Jul 03 2017 15:11:21 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 724Mon Jul 03 2017 16:10:02 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainView.jsx name: ReferenceError message: GLOBALS is undefined line: 91Mon Jul 03 2017 16:10:19 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/CopyPastePanel/app/includes/mainView.jsx name: ReferenceError message: array_lof_layers is undefined line: 83Mon Jul 03 2017 17:06:38 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 154Mon Jul 03 2017 17:07:50 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Aucun document n'est ouvert. line: 88Mon Jul 03 2017 17:11:07 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Aucun document n'est ouvert. line: 88Mon Jul 03 2017 17:15:12 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/ImportLayersApp.jsx name: TypeError message: undefined is not an object line: 56Mon Jul 03 2017 17:26:15 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: update_source is not a function line: 150Mon Jul 03 2017 17:54:10 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 142Mon Jul 03 2017 17:56:48 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 140Mon Jul 03 2017 18:04:59 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/helper/ui/ui.jsx name: TypeError message: Bad argument Please select the target document line: 44Mon Jul 03 2017 18:05:12 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/helper/ui/ui.jsx name: TypeError message: Bad argument Please select the target document line: 44Mon Jul 03 2017 18:07:01 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/helper/ui/ui.jsx name: TypeError message: Bad argument Please select the target document line: 44Mon Jul 03 2017 18:07:06 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/helper/ui/ui.jsx name: TypeError message: Bad argument Please select the target document line: 44Tue Jul 04 2017 09:24:09 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/indesign/document/document.jsx name: InvalidArgumentError message: The file do not exist line: undefinedTue Jul 04 2017 09:27:54 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 35Tue Jul 04 2017 15:00:57 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: Object is invalid line: 47Tue Jul 04 2017 15:30:00 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Object does not support the property or method 'textFrames' line: 50Tue Jul 04 2017 15:36:52 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: textframes.duplicate is not a function line: 61Tue Jul 04 2017 15:38:27 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: Object is invalid line: 45Tue Jul 04 2017 15:40:28 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 52Tue Jul 04 2017 16:40:11 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 40Tue Jul 04 2017 16:56:14 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/dependencies/extendscript-library/lib/indesign/document/document.jsx name: InvalidArgumentError message: The file do not exist line: undefinedTue Jul 04 2017 17:03:32 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Object does not support the property or method 'length' line: 54Thu Jul 06 2017 11:40:29 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Un calque portant le m�me nom existe d�j�. line: 50Thu Jul 06 2017 11:40:59 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: Error message: Un calque portant le m�me nom existe d�j�. line: 50Thu Jul 06 2017 11:48:35 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 41Thu Jul 06 2017 11:49:09 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 41Thu Jul 06 2017 11:49:35 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: my.mainView.pans.layers.getElements is not a function line: 41Thu Jul 06 2017 11:52:28 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: my.mainView.pans.layers.my_panel.getElements is not a function line: 41Thu Jul 06 2017 11:57:00 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: my.mainView.pans.layers.my_panel.getElements is not a function line: 41Thu Jul 06 2017 12:25:08 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: ReferenceError message: my.array_of_groups[i].my_group.getElements is not a function line: 44Thu Jul 06 2017 13:11:32 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 65Thu Jul 06 2017 13:12:13 GMT+0200 [ERROR] [ESTK] file: /Applications/MAMP/htdocs/images3-scripts/ImportLayers/app/includes/mainController.jsx name: TypeError message: undefined is not an object line: 65
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "gasser-media-scripts",
3+
"version": "1.0",
4+
"homepage": "http://www.gasser-media.ch",
5+
"authors": [
6+
"Bastien Eichenberger"
7+
],
8+
"description": "scripts based on the library Extendscript-library",
9+
"dependencies": {
10+
"extendscript-library": "[email protected]:bastienEichenberger/extendscript-library.git"
11+
}
12+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "extendscript-library",
3+
"homepage": "http://www.extendscript-library.org",
4+
"main": "lib",
5+
"authors": [
6+
"Bastien Eichenberger"
7+
],
8+
"description": "ExtendScript-library is a JavaScript library. This library has been created in order to support people who'd like write automation scripts for Adobe Creative Suite",
9+
"license": "BSD",
10+
"ignore": [
11+
"/*",
12+
"!lib/*"
13+
],
14+
"_release": "7adf281d7d",
15+
"_resolution": {
16+
"type": "branch",
17+
"branch": "master",
18+
"commit": "7adf281d7d5afbbdab29320c1810b7bc5239fdab"
19+
},
20+
"_source": "[email protected]:bastienEichenberger/extendscript-library.git",
21+
"_target": "*",
22+
"_originalSource": "[email protected]:bastienEichenberger/extendscript-library.git"
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "extendscript-library",
3+
"version": "2.0",
4+
"homepage": "http://www.extendscript-library.org",
5+
"main": "lib",
6+
"authors": [
7+
"Bastien Eichenberger"
8+
],
9+
"description": "ExtendScript-library is a JavaScript library. This library has been created in order to support people who'd like write automation scripts for Adobe Creative Suite",
10+
"license": "BSD",
11+
"ignore": [
12+
"/*",
13+
"!lib/*"
14+
]
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@include "config.jsx"
2+
//@include "constants.jsx"
3+
//@include "globals.jsx"
4+
5+
//@include "../gateway/gateway.jsx"
6+
7+
//@include "../log/log.jsx"
8+
9+
//@include "../shell/shell.jsx"
10+
11+
//@include "../ui/ui.jsx"
12+
13+
//@include "../utils/array.jsx"
14+
//@include "../utils/date.jsx"
15+
//@include "../utils/file.jsx"
16+
//@include "../utils/math.jsx"
17+
//@include "../utils/object.jsx"
18+
//@include "../utils/string.jsx"
19+
//@include "../utils/utils.jsx"
20+
21+
//@include "../xml/xml.jsx"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Module with the config of the helper library
3+
* @namespace Config
4+
* @memberOf H
5+
* @author Bastien Eichenberger
6+
*/
7+
H.Config = (function (my) {
8+
9+
10+
/**
11+
* Function to init the helper library
12+
* @function init
13+
* @memberOf H.Config
14+
*/
15+
my.init = function () {
16+
}
17+
18+
return my;
19+
})(H.Config || {});

public-scripts/ImportLayers/dependencies/extendscript-library/lib/helper/config/constants.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** * Module with constants * @namespace Constants * @memberOf H * @author Bastien Eichenberger */H.Constants = (function (my) { /** * Object with constants * @private * @memberOf PS.Constants * @type {Object} * @property {String} MY_CONST * @property {Number} MY_INTEGER */ var MY_CONSTANTS = { VERSION: 1.0 }; /** * Function to get a constant * @function get * @memberOf PS.Constants * @param {string} name * @returns {*} */ my.get = function (name) { return MY_CONSTANTS[name]; } return my;})(H.Constants || {});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Module with globals variables
3+
* @namespace Globals
4+
* @memberOf H
5+
* @author Bastien Eichenberger
6+
*/
7+
H.Globals = (function(my) {
8+
9+
/**
10+
* log_level the severity log level, by default set to debug
11+
* @public
12+
* @memberOf H.Globals
13+
* @type {Number}
14+
*/
15+
my.log_level = 0;
16+
17+
18+
19+
return my;
20+
})(H.Globals || {} );

0 commit comments

Comments
 (0)