schroef
Advisor
schroef
Advisor
Activity
‎Jan 30, 2018
07:15 AM
Is there a method for rachellefacistolmata script to export the image but take the orginal linked image into account. Now it exports a JPG using the frames ratio. Not sure if this is clear, ive added some screengrabs to make it more clear Placed image exported image Original linked image My guess its due to the " rect = rect.parent.parent; if (!(rect.hasOwnProperty("graphics"))) { "
... View more
‎Dec 14, 2017
01:20 PM
Well after hours of looking i did found some where that its native code is POINTS. wtf... why the hustle? why cant we just declare something, it keeps measuring in points. In order to use true MM i need to receive the edit value then make a calculation from MM * bse value (Points). This code is weird man I read a lot about setting pref units and doc untis. But if you all do that it still doesnt matter, as the calculation seems to be still in points. Perhaps that depends on what is used. I guess thats the bugger here. I do say this scripting is powerful, but its wy to complicated. PS Liphou thanks for pointing out other possibilities and methods of usage. I hope ill remember those. PS what happens if you calculate using a str doesnt the str need to be converted to a int (numerical value)? SOrry thats python in my head yelling NO!!!!
... View more
‎Dec 12, 2017
09:47 PM
1 Upvote
I also figured out why the script always shows points, thats how it works. How super weird.... when i input 3, it will show 3pt but actually excecutes 3mm??? This language is wicked man! I cant seem to see any logic in this language. Im doing a lot of python and perhaps thats holding me back to see this logic. I dont know, but i find myself typing tons of code for the super simple things. Finding this stuff on google also doesnt really help. Where as i need to find something for Python it much easier.
... View more
‎Dec 12, 2017
08:02 PM
I know about nothing about adobe javascript, do know a bit of other languages. Im bugging with the standard script which comes along with indesign. Its the AdjustLayout.jsx. Its setup in Points, but it want it to show millimeters from the start. So i changed all the items which where points. I dont know how but as soon as the input field is set to a variable its seem to be back at Points. How is this possible when all my settings are in MM the document settings as well as main app settings when nothing is open is in MM var units = 'millimeters'; // 0-inches, 1-milllimeters, 2-points //app.preferences.setIntegerPreference("rulerType", units) app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits[units]; app.activeDocument.viewPreferences.verticalMeasurementUnits= MeasurementUnits[units]; main(); function main(){ //Make certain that user interaction (display of dialogs, etc.) is turned on. // app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; if(app.documents.length != 0){ if(app.activeDocument.pageItems.length != 0){ myDisplayDialog(); } else{ alert("Document contains no page items."); } } else{ alert("Please open a document and try again."); } } function myDisplayDialog(){ var myLabelWidth = 70; var myDialog = app.dialogs.add({name:"Adjust Layout"}); var myPageNames = myGetPageNames(); with(myDialog.dialogColumns.add()){ with(borderPanels.add()){ with(dialogColumns.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Start Page:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ var myStartPageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:0}); } } with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"End Page:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ var myEndPageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:myPageNames.length-1}); } } } } with(borderPanels.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Even Pages", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Horizontal:", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Vertical:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ staticTexts.add({staticLabel:""}); var myEvenXField = measurementEditboxes.add({editValue:-3, editUnits:MeasurementUnits.millimeters}); var myEvenYField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.millimeters}); // alert(myEvenXField) // , Units:MeasurementUnits.millimeters // alert(measurementEditboxes.value) } } } with(borderPanels.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Odd Pages", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Horizontal:", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Vertical:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ staticTexts.add({staticLabel:""}); var myOddXField = measurementEditboxes.add({editValue:3, editUnits:MeasurementUnits.millimeters}); var myOddYField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.millimeters}); } } } } var myResult = myDialog.show(); if(myResult == true){ app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS; var myStartPageName = myPageNames[myStartPageDropdown.selectedIndex]; var myEndPageName = myPageNames[myEndPageDropdown.selectedIndex]; if(myCheckPageRange(myStartPageName, myEndPageName) == true){ // alert(myEvenXField.editValue) var myEvenX = myEvenXField.editValue; var myEvenY = myEvenYField.editValue; var myOddX = myOddXField.editValue; var myOddY = myOddYField.editValue; alert(myEvenX) myDialog.destroy(); myAdjustPages(myEvenX, myEvenY, myOddX, myOddY, myStartPageName, myEndPageName); } else{ myDialog.destroy(); alert("Invalid page range."); } } else{ myDialog.destroy(); } } function myAdjustPages(myEvenX, myEvenY, myOddX, myOddY, myStartPageName, myEndPageName){ var myPage, myPageAdjust; // Set the transform content property to true so that content will move with frames. //myOldTransformContent = app.transformPreferences.transformContent; //app.transformPreferences.transformContent = true; // var myOldXUnits = app.activeDocument.viewPreferences.horizontalMeasurementUnits; // var myOldYUnits = app.activeDocument.viewPreferences.verticalMeasurementUnits; // //Set the measurement units to points. // app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters; // app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters; //Save the old page numbering app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS; var myOldPageNumbering = app.generalPreferences.pageNumbering; app.generalPreferences.pageNumbering = PageNumberingOptions.section; var myStartPage = app.activeDocument.pages.item(myStartPageName); var myEndPage = app.activeDocument.pages.item(myEndPageName); //Set page numbering to absolute app.generalPreferences.pageNumbering = PageNumberingOptions.absolute; //Does the document start with an even page? if(myCheckPageStart(app.activeDocument) == false){ myPageAdjust = 1; } else{ myPageAdjust = 0; } for(var myCounter = (myStartPage.documentOffset-1); myCounter < myEndPage.documentOffset; myCounter++){ myPage = app.activeDocument.pages.item(myCounter); var myPageValue = myPage.documentOffset; myPageValue = myPageValue + myPageAdjust; if(myPageValue % 2 == 0){ //Page is an even page. myAdjustPage(myPage, myEvenX, myEvenY); } else{ //Page is an odd page. myAdjustPage(myPage, myOddX, myOddY); } } //Reset the transform content and measurement units to their original values. // app.activeDocument.viewPreferences.horizontalMeasurementUnits = myOldXUnits; // app.activeDocument.viewPreferences.verticalMeasurementUnits = myOldYUnits; // //app.transformPreferences.transformContent = myOldTransformContent; // app.generalPreferences.pageNumbering = myOldPageNumbering; } function myAdjustPage(myPage, myX, myY){ var myPageItem; var myResetItemLock = false; var myResetLayerLock = false; for(var myCounter = 0; myCounter < myPage.pageItems.length; myCounter ++){ myPageItem = myPage.pageItems.item(myCounter); if(myPageItem.locked == true){ myPageItem.locked = false; myResetItemLock = true; } if(myPageItem.itemLayer.locked == true){ myPageItem.itemLayer.locked = false; myResetLayerLock = true; } myPageItem.move(undefined, [myX, myY]); if(myResetItemLock == true){ myPageItem.locked = true; } if(myResetLayerLock == true){ myPageItem.itemLayer.locked = true; } } AutoEnum.AUTO_VALUE alert(AutoEnum.AUTO_VALUE) } function myGetPageNames(){ var myPageNames = new Array; for(myCounter = 0; myCounter < app.activeDocument.pages.length; myCounter ++){ myPageNames.push(app.activeDocument.pages.item(myCounter).name); } return myPageNames; } function myCheckPageStart(myDocument){ var mySection = myDocument.sections.item(0); if(mySection.continueNumbering == true){ //Starting page number is defined by other documents in the book return true; } if(mySection.pageNumberStart % 2 == 0){ //Starting page number is an even page. return false; } else{ //Starting page number is an odd page. return true; } } function myCheckPageRange(myStartPageName, myEndPageName){ var myStartIndex = app.activeDocument.pages.item(myStartPageName).documentOffset; var myEndIndex = app.activeDocument.pages.item(myEndPageName).documentOffset; if(myStartIndex <= myEndIndex){ return true; } else{ return false; } }
... View more
‎Dec 12, 2017
06:58 PM
I got something moving now with this code var mydoc=app.documents.item(0); //var mytexts=mydoc.stories.everyItem().paragraphs.everyItem().getElements(); var mytext=mydoc.stories.everyItem() var mytexts=mydoc.stories.everyItem().getElements(); //var texFrames = mytexts .textContainers for (i=0;i<mytexts.length;i++) { var texFrames = mytexts.textContainers var myX = '3'; var myY = '3'; texFrames[0].move(undefined, [3, 3]); When i tried to add myX it gives me a error that nothing is given???
... View more
‎Dec 12, 2017
06:32 PM
Sorry the items obj = mytext should not be commented out. Here's a image, its a catalogus which i have setup using linked Excell sheets with ranges so it keeps updating. Before i started and i knew this would be a issues. I asked the person to make a list of items which are gonna be in there, wishiing him not to change it and be sure of that. Well ofcourse stuff changes now .... duh!!! He has been deleting items and shuffling them. But the items are setup using bleed left and right. I tried looking into using data merge, but i preferred this workflow. Yet now i need to change quite a lot. So i guess data merge would have been better duhhh 2 I hacked together some script, after much looking around as usual, which adjust that main bar in blue and light grey. These have been setup so the size is automated. Perhaps i should have set the scaling point to the center and not TL. Now i need to move all the stuff. Im going to add the bleed for the bars in master page and manually or perhaps by other script adjust the frame with images.... dont know yet. is this more clear? PS one 'small' other question. I tried looking at the LayoutAdjust.jsx script. This could have helped me major, why is that when i changed everything inside there to millimeters. It keeps using points as measurement. All my settings are in millimeters. Its so weird, there are these input fields and there are set to mm. When i catch the output its in points, no where in this document or in my prefs does it says points??? i hate //AdjustLayout.jsx //An InDesign JavaScript /* @@@BUILDINFO@@@ "AdjustLayout.jsx" 3.0.0 15 December 2009 */ //Moves the content of even/odd pages by specified amounts; attempts to get //objects back into the correct position after a master page margin change //and/or page insertion. // // //For more on InDesign/InCopy scripting see the documentation included in the Scripting SDK //available at http://www.adobe.com/devnet/indesign/sdk.html //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com. // /*Unit list 0 : point 1 : pica 2 : inch 3 : mm 4 : cm 5 : H/Q 6 : px */ var units = 'millimeters'; // 0-inches, 1-milllimeters, 2-points //app.preferences.setIntegerPreference("rulerType", units) app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits[units]; app.activeDocument.viewPreferences.verticalMeasurementUnits= MeasurementUnits[units]; main(); function main(){ //Make certain that user interaction (display of dialogs, etc.) is turned on. app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; if(app.documents.length != 0){ if(app.activeDocument.pageItems.length != 0){ myDisplayDialog(); } else{ alert("Document contains no page items."); } } else{ alert("Please open a document and try again."); } } function myDisplayDialog(){ var myLabelWidth = 70; var myDialog = app.dialogs.add({name:"Adjust Layout"}); var myPageNames = myGetPageNames(); with(myDialog.dialogColumns.add()){ with(borderPanels.add()){ with(dialogColumns.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Start Page:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ var myStartPageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:0}); } } with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"End Page:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ var myEndPageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:myPageNames.length-1}); } } } } with(borderPanels.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Even Pages", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Horizontal:", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Vertical:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ staticTexts.add({staticLabel:""}); var myEvenXField = measurementEditboxes.add({editValue:-3, editUnits:MeasurementUnits.millimeters}); var myEvenYField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.millimeters}); } } } with(borderPanels.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Odd Pages", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Horizontal:", minWidth:myLabelWidth}); staticTexts.add({staticLabel:"Vertical:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ staticTexts.add({staticLabel:""}); var myOddXField = measurementEditboxes.add({editValue:3, editUnits:MeasurementUnits.millimeters}); var myOddYField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.millimeters}); } } } } var myResult = myDialog.show(); if(myResult == true){ var myStartPageName = myPageNames[myStartPageDropdown.selectedIndex]; var myEndPageName = myPageNames[myEndPageDropdown.selectedIndex]; if(myCheckPageRange(myStartPageName, myEndPageName) == true){ alert(myEvenXField.editValue) var myEvenX = myEvenXField.editValue; var myEvenY = myEvenYField.editValue; var myOddX = myOddXField.editValue; var myOddY = myOddYField.editValue; myDialog.destroy(); myAdjustPages(myEvenX, myEvenY, myOddX, myOddY, myStartPageName, myEndPageName); } else{ myDialog.destroy(); alert("Invalid page range."); } } else{ myDialog.destroy(); } } function myAdjustPages(myEvenX, myEvenY, myOddX, myOddY, myStartPageName, myEndPageName){ var myPage, myPageAdjust; // Set the transform content property to true so that content will move with frames. //myOldTransformContent = app.transformPreferences.transformContent; //app.transformPreferences.transformContent = true; // var myOldXUnits = app.activeDocument.viewPreferences.horizontalMeasurementUnits; // var myOldYUnits = app.activeDocument.viewPreferences.verticalMeasurementUnits; // //Set the measurement units to points. // app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters; // app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters; //Save the old page numbering var myOldPageNumbering = app.generalPreferences.pageNumbering; app.generalPreferences.pageNumbering = PageNumberingOptions.section; var myStartPage = app.activeDocument.pages.item(myStartPageName); var myEndPage = app.activeDocument.pages.item(myEndPageName); //Set page numbering to absolute app.generalPreferences.pageNumbering = PageNumberingOptions.absolute; //Does the document start with an even page? if(myCheckPageStart(app.activeDocument) == false){ myPageAdjust = 1; } else{ myPageAdjust = 0; } for(var myCounter = (myStartPage.documentOffset-1); myCounter < myEndPage.documentOffset; myCounter++){ myPage = app.activeDocument.pages.item(myCounter); var myPageValue = myPage.documentOffset; myPageValue = myPageValue + myPageAdjust; if(myPageValue % 2 == 0){ //Page is an even page. myAdjustPage(myPage, myEvenX, myEvenY); } else{ //Page is an odd page. myAdjustPage(myPage, myOddX, myOddY); } } //Reset the transform content and measurement units to their original values. // app.activeDocument.viewPreferences.horizontalMeasurementUnits = myOldXUnits; // app.activeDocument.viewPreferences.verticalMeasurementUnits = myOldYUnits; //app.transformPreferences.transformContent = myOldTransformContent; app.generalPreferences.pageNumbering = myOldPageNumbering; } function myAdjustPage(myPage, myX, myY){ var myPageItem; var myResetItemLock = false; var myResetLayerLock = false; for(var myCounter = 0; myCounter < myPage.pageItems.length; myCounter ++){ myPageItem = myPage.pageItems.item(myCounter); if(myPageItem.locked == true){ myPageItem.locked = false; myResetItemLock = true; } if(myPageItem.itemLayer.locked == true){ myPageItem.itemLayer.locked = false; myResetLayerLock = true; } myPageItem.move(undefined, [myX, myY]); if(myResetItemLock == true){ myPageItem.locked = true; } if(myResetLayerLock == true){ myPageItem.itemLayer.locked = true; } } } function myGetPageNames(){ var myPageNames = new Array; for(myCounter = 0; myCounter < app.activeDocument.pages.length; myCounter ++){ myPageNames.push(app.activeDocument.pages.item(myCounter).name); } return myPageNames; } function myCheckPageStart(myDocument){ var mySection = myDocument.sections.item(0); if(mySection.continueNumbering == true){ //Starting page number is defined by other documents in the book return true; } if(mySection.pageNumberStart % 2 == 0){ //Starting page number is an even page. return false; } else{ //Starting page number is an odd page. return true; } } function myCheckPageRange(myStartPageName, myEndPageName){ var myStartIndex = app.activeDocument.pages.item(myStartPageName).documentOffset; var myEndIndex = app.activeDocument.pages.item(myEndPageName).documentOffset; if(myStartIndex <= myEndIndex){ return true; } else{ return false; } } I hate javascript!
... View more
‎Dec 12, 2017
05:51 PM
Sorry for bugging here, but im loosing my mind here with scripting. I want to change the default AdjustLayout.jsx script to metric using millimeters, so change all points references in the file. But when the popup comes it keeps calculating my input to points. How is this even possible? I know this is illustrator but the scripting is same language right?
... View more
‎Dec 12, 2017
04:02 PM
Im looking for a script which can move items on a page. Ive tried looking in the scripting, but i find this method so weird and difficult. Java really needs a lot of code to do something.... I have something like this, copy and pasted together. But i get a alert OBJ is not a function var mydoc=app.documents.item(0); var mytexts=mydoc.stories.everyItem().getElements(); for (i=0;i<mytexts.length;i++) { alert(mytexts) // var obj = mytexts; // var transMatrix = app.transformationMatrices.add({horizontalTranslation: 20}); obj.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.TOP_LEFT_ANCHOR, transMatrix); // mytexts.move([-.25,-.25]) I tried a couple items but keep getting errors. Ive search now for about 2 hours and i cant find it. Why doesnt the code use simple xLocation or xTranslatee using simple coordinates system. No they come with some brute matric system. pfffff
... View more
‎Nov 29, 2017
01:35 PM
Well the other problem is, you can only warp in Photoshop if the layer is rasterized. I really missing the smart object here. Warping image result in really blurry image and its a destructive workflow. They should add warp functions like Illustrator can do, warp from top mesh. Now i need to jump between these 2 apps to do such EDIT .... I should have double checked before answering. I thought my object was already a photoshop smart object, but it was still a vector pasted smart object. Conversion in PS does do the warp, yeah!!!
... View more
‎Nov 16, 2017
07:15 PM
Owww, didnt this got into indesign section? It's indesign
... View more
‎Nov 16, 2017
03:42 PM
Ive setup a document in where i use linked excel sheets to fill tables. Each column has it cellStyle, ive pre applied these so i have each and every other gets a light grey color and the left column has white line on the right. Now sometimes when i need to update the table, somehow the columns loose the cellStyle. I dont understand why or whats happening. But reapplying them manual is tedious ofcourse. Ive tried look at some scripts and have managed to pull of some parts as column with etc. But applying the cellStyle per column i keep getting a error cellStyleName = ["Product - Row 1", "Product - Row 2", "Specs - Row 1", "Specs - Row 2"] //newHeight = app.activeScript.name.split('_')[2].split('.')[0]; cellWidth = ["108", "105", "25", "54"] cellColor = ["Red", "Red", "Red", "Red"] //cellnames = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements(); for (b = 0; b < cellStyleName.length; b++) if (app.activeDocument.cellStyles.item(cellStyleName).isValid) app.doScript(sizeRows, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Undo Resize Height of " + cellStyleName); else alert('There is no Cell Style named "' + cellStyleName + '"'); function colorColumn() { columnarray = app.activeDocument.stories.everyItem().tables.everyItem().columns; for (i = 0; i < columnarray.length; i++) { // alert(columnarray); if (i == 1) alert(a); columnarray.fillColor = "Red"; if (i == 2) alert(a); columnarray.fillColor = "Red"; // columnarray.appliedCellStyle.name = cellStyleName; } } function sizeRows() { cellarray = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements(); columnarray = app.activeDocument.stories.everyItem().tables.everyItem().columns; // for (i = 0; i < columnarray.length; i++) { // // alert(columnarray); // alert(i); // columnarray.fillColor = "Red"; // // columnarray.appliedCellStyle.name = cellStyleName; // // } // cellEmpty = app.activeDocument.stories.everyItem().tables.everyItem() // table = app.activeDocument.stories.everyItem().tables; // for (i = 0; i < table.cells.length; i++) { // if (table.cells.texts[0].length == 0) // table.cells.fillColor = 'Red'; // } for (a = 0; a < cellarray.length; a++) colorColumn(a); if (cellarray.appliedCellStyle.name == cellStyleName) cellarray.width = cellWidth; else if (cellarray.appliedCellStyle.name == "[None]") cellarray.appliedCellStyle = cellStyleName; // columnarray.fillColor = "Red"; }
... View more
‎Nov 09, 2017
11:38 AM
I think the problem with this method is the blue and gray bar. The left one has bleed so does the right get it. I think best option is to make it without the bleed. Add the bleed to a master page, then manually adjust image to add bleed as well or make a script for this. Thanks for giving a tip!
... View more
‎Nov 09, 2017
08:42 AM
Thanks Mike! I also thought about that, i was curious if this could be done without that. Cause one small issue is that there are going to be image in the big frame. So i cant use master page then, but on the other side. I im manually linking these, so that doesnt matter actually PS how should i setup data merge if the design is jumping. So each even number has the layout flipped. Being the image right with the header right and the column on the left side? Im finding a method which is best to use, linked Excel or data merge. Cant really decide which way to go
... View more
‎Nov 09, 2017
06:25 AM
I got a small question with applying cell styles. Ive got a script where i can change 2 tables per page which adjusts the width of each row according to a cell style. Ive added 2 lists 1 has the cell style and one is for the 2 width of the columns. My problem now is that when i had setup the tables i used cell styles for the body, left and right column using table styles. My script doesnt seem to see these styles. It seems the script only check if they are manually applied. cellStyleName = ["Product - Row 1", "Product - Row 2", "Specs - Row 1", "Specs - Row 2"] cellWidth = ["108", "105", "35", "54"] cellColor = ["Red", "Red", "Red", "Red"] for (b = 0; b < cellStyleName.length; b++) if (app.activeDocument.cellStyles.item(cellStyleName).isValid) app.doScript(sizeRows, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Undo Resize Height of " + cellStyleName); else alert('There is no Cell Style named "' + cellStyleName + '"'); function sizeRows() { cellarray = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements(); for (a = 0; a < cellarray.length; a++) if (cellarray.appliedCellStyle.name == cellStyleName) cellarray.width = cellWidth; else if (cellarray.appliedCellStyle.name == "[None]") cellarray.appliedCellStyle = cellStyleName; } Ive tried adding a if statement in the sizeRows function which checks if appliedCellStyle.name == 'None'. But i keep getting errors I need to get the even and uneven numbers for cells i guess in order to apply the correct cell style. Essentually easch column has a cell style. Ive gotten script from the web and have tried looking into other script. Dont understand or can find the method to get column row instead rows. Most script seem to run and use row. It would be easier if i can apply the style to a complete column at once. Below is my setup. the table are made using linked Excel files for easier updating
... View more
‎Nov 08, 2017
06:04 PM
Its been quite a while ive worked with data merge. Now im trying to test if data merge is better than using linked xcel files in tables and how they update after changes. But its tedious work setting all pages and linking it. I've made a master with four tables on then plus headers, these are separate tables using the same file. Ive added cell range so i can keep the header styling as well as the body. What i like about data merge is that its super fast creating pages. But i run into issues when my design has bleed. Ive tried setting up a page with the bleed already in there but i then got a problem when i scale the page down again to A4. This is my setup with linked excel sheets, where separated the header for the product name. This is my setup trying to do data merge, page size setup with bleed added so i can use bleed in my design (A4 + 3mm) The trick im trying to pull of is that i make the pages with 3mm extra so A4 + 3mm = 213. Then later i resize the page back to A4 which makes the back stay and put the design sort of in the correct place. Problem is that i see a minor offset The spin of the book gets 15mm margin and outer sides are 12.5mm. Im wondering why i see the tables on the right page at a different location
... View more
‎Nov 06, 2017
09:07 PM
I was looking into how to use Excell sheets and cell range to make import a tables easier. I found a method where i can keep the header of a table and also have it apart from the main table so i can locate else where in my design. I notice there is however a issue when you change the sheet name, i get a "Cannot update link...." error. Is there a way we can check those cell range names in Indesign and perhaps relink them?
... View more
‎Oct 27, 2017
09:17 AM
Okay i read it, so declaring variable is better. But isnt my example working like that already. Cause each time a with statement is used it has a variable between () followed by variables which arent used that much
... View more
‎Oct 27, 2017
09:15 AM
Sorry for the late response, i didnt have email notification on This is a different version, i first had a version which check the system but also got errors with that. I know do have a system check but it seems to work on windows as well now. could you perhaps check it once more PS ill try to read that article you read. I dont use PS scripting a lot so i really dont know what is best. Also i never knew that using to much with statements isnt proper use of code Dropbox - PhotoshopCC_TheaStitcher_v11.zip
... View more
‎Aug 25, 2017
11:29 PM
Thomas, do you mind if i take part of your stitch code? I find the way you open a folder much easier then what i did with using the load stack and then run other scripts after that. This way i got 2 popups. Whereas now i only have one and i altered the input a bit. I skipped the binary image loading cause it wont swap images. Which i needed for the dropdown menu. Its a stitcher for tiles which are rendered by a render engine i use. There are 2 output methods thats why i added row by row and column by column. I used the icons to make it more clear for users. You can test it here, Dropbox - PhotoshopCC_TheaStitcher_v11.zip
... View more
‎Aug 25, 2017
05:29 PM
One thing i do notice. I used a if statement to check value of a dropdown menu. With certain input i change the image. When u use the method var f = new file("image", undefined, filename); and the replace the image in the if statement like this; iconImg.image = f; With the PNG load method the replacing does work. But using Binary method it wont. I will only load the images from the start. Here the complete code section; var f = new File (app.path + '/Presets/Scripts/blanco.png'); var f1 = new File (app.path + '/Presets/Scripts/row-row.png'); var f2 = new File (app.path + '/Presets/Scripts/col-col.png'); dlg.btnPnl = dlg.add('group', undefined, ''); // dlg.btnPnl.orientation = "row"; dlg.btnPnl.orientation = "row"; dlg.btnPnl.alignChildren = "right"; dlg.btnPnl = dlg.btnPnl.add('group'); with (dlg.msgPnl) { cancelBtn = dlg.btnPnl.add('button', undefined, 'Cancel', {name:'cancel'}); //[15, 105, 115, 125] buildBtn = dlg.btnPnl.add('button', undefined, 'Stitch', {name:'ok'}); // name:'ok',[125, 105, 225, 125] buildBtn.enabled = false; mydropList.onChange= function(){ if (mydropList.selection.text == "Row > Row" || mydropList.selection.text == "Column > Column"){ buildBtn.enabled = true; } else { buildBtn.enabled = false; } if (mydropList.selection.text == "Row > Row"){ t1.image = f1; } if (mydropList.selection.text == "Column > Column"){ t1.image = f2; } if (mydropList.selection.text == "Select order") { t1.image = f; } } }
... View more
‎Aug 25, 2017
02:26 PM
I got it to work now, i thought i needed to take just a small part of the binary creator. I need the whole section including the adobe Image meta data etc etc. SWEET!
... View more
‎Aug 25, 2017
02:24 PM
I tried the Binary creator, but im not sure which part of the code i need to take. I gave me a error when i used the last part. Gives me this; Error 25: Expected: ;.
... View more
‎Aug 25, 2017
02:13 PM
PS i see you have a image stitcher as well. I was actually working something like wise. But i used the load stack script and added a other script in it. Here's a link so you can check it. This one stitches the images according to their own size, users can choose to run it either row by row or column by column. PhotoshopCC_TheaStitcher_v6.zip
... View more
‎Aug 25, 2017
02:03 PM
Thanks! looks quite handy indeed. Ill check if it works as well. I now got good results using Chucks solution with the single quotes. var file = new File (app.path + '/Presets/Scripts/myImage.png');
... View more
‎Aug 25, 2017
09:39 AM
DOes anyone know if in the newer Photoshop its possible to access or add data for the Note tool?
... View more
‎Aug 24, 2017
04:09 PM
Looking again at yours, this should do the same. Yet i got a error by the user again. var FolderPath = app.path + "/"+ localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts"); var f = File(FolderPath + "/blanco.png"); var f1 = File(FolderPath + "/row-row.png"); var f2 = File(FolderPath + "/col-col.png");
... View more
‎Aug 24, 2017
04:07 PM
Thanks! ill try that. So forward slash would work then actually. What i dont get is why "../image.png" wont work in Windows. I got a user reporting error the about wrong image data.
... View more
‎Aug 24, 2017
10:28 AM
Im busy making a script which stitches images together using row by row and column by column method. Ive added a couple of script together into one script. To make the stitch method more clear i made 2 icons. Problem is that windows users get errors when the images need to be loaded. The icons are placed in the main script folder in the presets folder /Photoshop/Presets/Scripts/row-row.png. Im using OSX as system and there i could use "../row-row.png". This doesnt seems to work properly on windows. So i tried using backslash, but this give errors in the code as the backslash is for include specials. This is the part which loads the png images; var f = new File("../blanco.png"); var f1 = new File("../row-row.png"); var f2 = new File("../col-col.png"); I also tried this; if (File.fs == "Windows"){ var f = File("..\blanco.png"); var f1 = File("..\row-row.png"); var f2 = File("..\col-col.png"); } if (File.fs == "Macintosh"){ var f = File("../blanco.png"); var f1 = File("../row-row.png"); var f2 = File("../col-col.png"); } What is the best method to get windows look in the current folder of the presets/scripts/ folder?
... View more
‎Aug 22, 2017
07:20 PM
@ Paul Rigott, Super Thanks! i was almost freaking out why when i call the alert and simple get ....selection it spits out the dropdown text. I did not now this was a string then. What kind of format or text is at that point? I thought when not asking for the index you automatically get the string and thus value. Im perhaps confused by other types of coding like python or flash scripting.
... View more
‎Jul 09, 2017
02:54 PM
Just do a search you'll find them, pretty easy to do. I see Aman already gave you a link as well.
... View more
- « Previous
- Next »