Home > Indesign Javascript > Indesign Javascript Error

Indesign Javascript Error

GREP Plug-ins and Scripts InDesign FAQ Training and Consulting InDesign User Groups Watch & Listen Shop Forums Membership Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign! Older (CS3)Plugins and Scripts Using Old Scripts in CS3 David Blatner December 31, 2007 Tweet 14 CommentsShare This Tweet This Article Share on Facebook Email This Article Share on Google+ Pin This Article It seems like each day there is a new script coming out to do something cool in InDesign. But what about all the old scripts -- those that were written for CS or CS2? Can you use them in InDesign CS3? If you're a CS3 user with old scripts, you may find that they fail, offering nothing but a cryptic error message. But there's hope: InDesign has a special "cs2 emulation mode" that allows you to use many older scripts. The trick is to make a new folder inside this folder: Mac: Applications/Adobe InDesign/Scripts/Scripts Panel/ or Users/[username]/Library/Preferences/Adobe InDesign/Version 5.0/Scripts/ Windows: Program Files/Adobe/Adobe InDesign/Scripts/Scripts Panel/ or in XP: Documents and Settings\[username]\Application Data\Adobe\InDesign\Version 5.0\Scripts\ or in Vista: Users\[username]\AppData\Roaming\Adobe\InDesign\Version 5.0\Scripts\ The new folder should be called Version 4.0 Scripts You can then put your older scripts inside that folder. They'll show up in the Scripts panel (inside a similarly-named Version 4.0 Scripts folder), and you can run them by double-clicking on the script name (as usual). My understanding is that this won't work for all older scripts, but it does work for many of them, saving you the hassle of rustling up (or writing) a new version. Bonus Script Troubleshooting Tip By the way, I've gotten a couple of emails from people who simply can't get their scripts to run on their Mac. They even did clean installations and the scripts still don't work. I was flummoxed, but Ryan Russell-dedicated InDesignSecrets fan-came up with a solution that worked for him. He noticed (with the help of Adobe's tech support) that some of his folder names on his hard drive were slightly wrong. Specifically, the folders in this path: User>Library>Preferences>Adobe InDesign>Version 5.0 weren't named the same as in this path: User>Library>Cache>Adobe InDesign>Version 5.0 Apparently, that's all it takes for InDesign to break. He renamed the folders and all his scripts suddenly started working again. I don't know if that will help anyone else, but it's worth looking into. Bio Late

having trouble launching, or opening plugin... make a copy of your Indesign preferences and Indesign folder preferences user/library/preferences/Adobe InDesign (folder) and user/library/preferences/com.adobe.InDesign.plist then delete. Remembering your previous Indesign preferences is a good idea, take screenshots etc. if required. Clearing preferences will clear the shortcuts that you have setup and other things! There are 2 ways to clear the InDesign Preferences file, this is recommended if you get the following javascript error on startup of http://indesignsecrets.com/using-old-scripts-in-cs3.php InDesign after installation of the plug-in. Option 1. Start InDesign and then instantly afterwards press and hold Mac: Cmd+Alt+Ctrl+Shift Windows: Ctrl+Alt+Shift, when prompted press 'Yes' to delete preferences file, this will clear all keyboard and reset InDesign as if you installed it for the first time. Option 2. If you can't get that to https://designersbookshop.com/knowledge-base/articles/clear-preferences-solve-javascript-error/index.html work or you would like to save the current preferences file for some reason, do the following: Mac OSX Lion (10.7): The Library folder is hidden and you need to access it, do this: Open any folder and press Cmd+Shift+G Enter this: ~/Library/ and press Go, then go to: Preferences > Adobe InDesign > select the version (Version 5.0 = CS3) > Find the file called InDesign Defaults. Once you have done that you can either rename, save or just delete it. Then restart InDesign and it will create a new preference file. Below is directions for Windows:InDesign Defaults: Windows XP: C:\Documents and Settings \Application Data\Adobe\InDesign\ (Note: Prior to version 6 [CS4] the language folder is not used). Windows Vista or Windows 7: C:\Users\AppData\Roaming\Adobe\InDesign\ (Note: Prior to version 6 [CS4] the language folder is not used). InDesign SavedData: Windows XP: C:\Documents and Settings\Local Settings\Application Data\Adobe\InDesign\Caches\ (Note: Prior to version 6 [CS4] the language folder is not used). Windows Vista

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow http://stackoverflow.com/questions/12184848/indesign-scripting-object-is-invalid the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of https://www.safaribooksonline.com/library/view/scripting-indesign-cs34/9780596803599/ar01s07.html 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up inDesign scripting “Object is invalid” up vote 2 down vote favorite I'm trying to set height & insets indesign javascript for the first row of a table one way, and then all following rows to another set of values. I'm receiving a JavaScript error message when I run it: Error Number:45 Error String: Object is invalid Engine: main File: C:\... Line: 49 Source: app.activeDocument.stories.everyItem().tables.everyItem().rows[x].height = ".12 in"; Not sure where to go from here? Here is a pastebin of my current script http://pastebin.com/iUXgPZSM javascript indesign adobe-indesign share|improve this question asked Aug 29 indesign javascript error '12 at 19:04 Chuck 228418 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted The everyItem() method doesn't always work in every context. In this case, it doesn't work because you're setting an attribute, eg. height = ".12 in". It you get the elements first using getElements() and then loop through them, it will work. Also, note that you can't make the height of the rows smaller than the text size. InDesign just won't do it. In the example I provide I used 1 in since the .12 in appeared to be smaller than the default text size. Finally, I had a look at your pastebin script and you could probably clean it up a little bit by using variables instead of chains of functions. It might take up more "vertical space" but in the end it is more readable for other people. var doc = app.activeDocument; var everyStory = doc.stories.everyItem(); var everyTable = everyStory.tables.everyItem(); var allRows = everyTable.rows.everyItem().getElements(); for (var i=1, l=allRows.length; i < l; i++) { var row = allRows[i]; row.height = "1 in"; }; share|improve this answer edited Aug 31 '12 at 14:05 answered Aug 31 '12 at 13:52 Josh Voigts 2,3841928 add a comment| Your Answer draft saved draft discarded Sign up

CS3/4 with JavaScript by Peter Kahrel Published by O'Reilly Media, Inc. Scripting InDesign CS3/4 with JavaScript Introduction Hello World! The ExtendScript Toolkit (ESTK) Creating a Script In and Running it From the ESTK InDesign’s Object Model Parents Children Three Special Parents Collections of Objects Properties Methods The Object Model Viewer JavaScript Some General Rules Variables Reserved Words Strings Strings and Numbers Arrays Arrays Versus Collections Operators Statements Functions Interacting with the User Unicode Characters Catching Errors Running Scripts Working with Text Adding, Replacing, and Removing Text Inserting Special Characters Styling Text Locally Styling Text with a Character Style Styling Text with a Paragraph Style Paragraph Spacing Working with Tabs Some Missing Keyboard Shortcuts A Keyboard Shortcut for Semibold Swapping Two Lines/Paragraphs Indenting a Block of Text Find and Change The Basics Where to Search Format Settings Finding Things A Kerning Editor Find/Change with GREP Lower-Casing Acronyms with GREP Tables Anatomy of a Table Getting a Reference to a Table Snapping Columns Align on Units Shading Cells Processing All Tables in a Document Applying Table Styles Find and Change in Tables Only Text Frames Script Label/Name Frame Dimensions Resizing a Frame Moving a Frame Creating a Frame A Text Frame’s Page Number Graphics Captions Resources Acknowledgements About the Author Catching ErrorsWe’ve mentioned a few times by now that you should always test whether it’s safe to let a script do something. Two of the examples we’ve seen are the following:if (app.selection[0].constructor.name != "InsertionPoint") if (myString == "nonsense")These two checks are specific: the first one tests whether a selection is an insertion point; in the second one we make sure that we do something only if the varia

 

indesign javascript error number 45

Indesign Javascript Error Number p ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError You don't have JavaScript enabled This tool uses JavaScript and much of it will not work correctly without it enabled Please turn JavaScript back on and reload this page Please enter a title You can not post a blank message Please type your message and try again More discussions in InDesign All CommunitiesInDesign Replies Latest reply on Nov AM by Peter Spier Javascript Error Error number error string Objects is invalid line

indesign javascript error number 45 mac

Indesign Javascript Error Number Mac p GREP Plug-ins and Scripts InDesign FAQ Training and Consulting InDesign User Groups Watch Listen Shop Forums Membership Thanks for coming to InDesignSecrets com the world's resource for all things InDesign Older CS Plugins and Scripts Using Old Scripts in CS David Blatner December Tweet CommentsShare This Tweet This Article Share on Facebook Email This Article Share on Google Pin This Article It seems like each day there is a new script coming out to do something cool in InDesign But what about all the old scripts -- those that were written for CS or

indesign javascript error 45 mac

Indesign Javascript Error Mac p ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError You don't have JavaScript enabled This tool uses JavaScript and much of it will not work correctly without it enabled Please turn JavaScript back on and reload this page Please enter a title You can not post a blank message Please type your message and try again More discussions in InDesign All CommunitiesInDesign Replies Latest reply on Mar PM by Peter Spier Adobe InDesign CS for Mac won't run Receiving javascript error