InDesign Script Export Named Pages CHANGE LOG Version 8.7 (240411) a. New function 'resolveExistingFile' to deconstruct path and add 'copy'. b. Add variables for year, month, and day. c. Rebuild i18n. Version 8.6 (240126) a. Not replacing files add 'copy' to new file that would otherwise overwrite. Version 8.5 (231203) a. Revise interface to landscape. b. Add option how to transform illegal characters rather than always remove. c. Rebuild i18n. d. Miscellaneous. Version 8.4 (231111) a. Disable new InDesign feature image suffix that adds page number. b. For document path use doc.filePath instead of doc.fullName.path. c. Progress increment before display not after. d. Miscellaneous. Version 8.3 (231029) a. Enhance compatibility with older versions of InDesign. b. Add version to error message. c. Miscellaneous. Version 8.2 (230918) a. PDF print disable preset property exportAsSinglePages. b. Error textFrame invalid object itemLayer wrap in try/catch. c. Miscellaneous. Version 8.1 (230821) a. Set 'folderXxxxxLastValid' once selected. b. Name from content remove zero-width characters. c. Name from content make special spaces normal space. d. Add new options PDF Interactive. e. Export preferences use enumerated arrays. f. Miscellaneous. g. Rebuild i18n. Version 8.0 (230526) Release 7.9.1 Version 7.9.1 (230522) a. Add variable character style. b. Rebuild i18n. Version 7.9 (230419) Release 7.8.1 Version 7.8.1 (230415) a. Parent page fix remove prefix at first hyphen. b. Restore original order of file name transformations. c. Remove slashes before prefix/suffix, then all except slashes after. Version 7.8 (230411) Release 7.7.4 Version 7.7.4 (230408) a. From 7.7.2 event handler 'cbRemoveDiacritics' missing 'onClick'. b. Re-arrange building file name so prefix and suffix are last. c. Look for slashes and create subfolders if found. d. Function 'validateFileName' use polyfill trim(). e. Add function 'validatePrefixSuffix'. No trim and allow slash. f. Date and time separators add missing call to 'changeOption'. Version 7.7.3 (230403) a. Add options recent folders remove and clear all. b. Rebuild i18n. Version 7.7.2 (230403) a. Move option alert done to panel 'Options'. b. Rename 'Alert done' => 'Alert when done'. c. Add option interactive PDF 'Create Acrobat Layers'. d. Set properties individually rather than properties object. e. Add missing 'cbRemoveDiacritics.onClick'. f. Re-order interface options. g. Miscellaneous. h. Rebuild i18n. Version 7.7.1 () a. Add option alert done. b. Rebuild i18n. Version 7.7 (230317) a. Read script folder for i18n make consistent with AI and PS. b. Validate JPG and PNG resolution max 2400. c. To match Adobe changes, update 'master' to 'parent'. d. Remove legacy settings. e. Miscellaneous. f. Rebuild i18n. Version 7.6 (230112) a. Fix settings option uppercase. Version 7.5 (230105) a. Update i18n. Version 7.4 (221201) a. Remove duplicate 'listFormat.onChange'. b. Miscellaneous. Version 7.3 (221029) a. Folder property 'fsName' use 'fullName' instead. b. Simplify variable docFolder to decode(doc.filePath). c. New function setFolder climb folder hierarchy until one exists. d. Add script variables 'folderXXXXLastValid'. e. Check include section prefix to avoid section prefix twice in variable 'pageLabel'. Version 7.2.1 (221024) a. Variable page name use 'page.name' only (already includes section name). Version 7.2 (221019) a. Save settings include options allow when name is [Default]. b. Settings apply add function setFolder. c. New handling settings output folder. d. Miscellaneous. Version 7.1 (221010) a. Function process rename var 'file' => 'fileOutput'. a. Folder objects global and create in btnOK.onClick. c. Update panel 'Settings' to match others. d. Save output folder always, but remove if option unchecked when save settings. e. Override saved output folder if settings.folderOutputDefault is set. f. Window output more on OK save settings to store outputFolderDefault. g. Rename var 'folderOutputDefault' => 'folderDoc'; confused with setting.folderOutputDefault. h. Override output folder when settings are selected and have output folder. i. Alert 'Done' when finished. Version 7.0 (220928) a. On load folderOutputMRU skip any that no longer exist. b. Remove //@target c. Check app name and warn if wrong app for script. Version 6.9.1 (220922) a. PDF interactive enable layers. Version 6.9 (220825) a. Compare listFormat.selection.text to index instead. Version 6.8 (220807) a. Add options date and time separators. b. Rebuild i18n. Version 6.7 (220803) a. Add option name from content 'text link name'. b. Settings current break apart single return statement. c. Settings apply and current try/catch/alert errors. d. Improved done alert or error. e. Rebuild i18n. Version 6.6 (220708) a. Function nameFromContent rename fileName => name. b. Updated (again) function settings.setList. c. Instead of 'load lists' later, load when list created then add blank items. d. Miscellaneous. Version 6.5 (220707) Incorporate changes up to version 6.4.13: a. Updated function settings.setList. b. Style lists define empty. c. Load style lists after define. d. Style list add separators so minimum two items. e. Do not disable style lists. f. Style lists on activate set radio button. g. Settings lock and unlock move to listSettings.onChange. h. Delete button disable move to listSettings.onChange. Further changes: i. Get format by index instead of name. j. Draw extension from constant array that matches drop down list. k. If not replace then increment version when file exists. l. Replace existing files default false. m. Rename fileName => baseName while building it, then make fileName. Version 6.4 (220619) a. Roll back loading styles to 6.3 (publish 6.2.6). Use doc.allXxxStyles instead of doc.xxxStyles. Restore function getStyleNames instead of loading inline. b. Remove function sortCi. c. Remove change v6.2.6 style name array don't sort unless length > 1. Version 6.3.2 (220616) a. Build styles in place without calling function. b. Rename function getStyle => itemByName. Version 6.3.1 (220615) a. Get styles only if Name from content enabled. b. Sort style arrays in script scope using function sortCi. Version 6.3 (220615) Publish 6.2.6 Version 6.2.6 (220614) a. Equals or not null make strict comparison. b. Make style arrays of names, not arrays of style objects. c. Style name array don't sort unless length > 1. d. Get styles once, not every page every time through loop. e. Rename list.*style => list.*styles (plural). f. ConfigureUi enable dropdown lists with = radio button value instead of if else. Version 6.2.1 (220612) a. Remove unnecessary dropdown lists onActivate. Version 6.2 (220601) a. Restore language extensions to script scope. Version 6.1 (220527) a. Update check for missing links and overset text. b. Move language extensions to global scope. c. During process never interact to suppress dialogs then restore. d. Miscellaneous. Version 6.0 (220524) a. Update regex for fileName. b. Use doc 'allParagraphStyles' etc. to build lists. c. Miscellaneous. Version 5.9 (220519) a. Make individual warnings for exceeds name/path limit. b. Add OneDrive limit of 400, use 392. c. Assign new verbiage to i18n and rebuild. Version 5.8.2 (220512) a. Instead of limit file name, warn and stop. b. Test path limit per platform. Windows is 260, macOS is 1024. But safer values are 248 and 1016. Version 5.8.1 (220510) a. Replace option 'Single/Front+back' with 'In Groups of'. b. Rebuild i18n. Version 5.8 (220427) a. Limit file name length. b. Detect and convert legacy variable ^N to ^M# Version 5.7 (220423) a. Create new function 'numToAlpha' for next changes. b. Add incremental letters to any, to images, and to master pages. c. Add incremental numbers to images. d. Master pages incremental numbers change placeholder from ^N to ^M# for consistency. e. Rebuild i18n. Version 5.6 (220420) a. Do not export page if name from content and filename is empty. b. Recognize all placed graphics rather than images only. Version 5.5 (220401) a. Progress display page name rather than absolute number. b. Tighten UI vertically. User on small screen can't reach OK button. c. Pages/spreads and single/front+back call changeOption. Version 5.4 (220326) a. Paragraph style remove end content on new line. Only end on return. b. If not exporting spreads, include text frames off page, near page. c. Preserve ruler origin, set to spreads, and restore when done. c. Hoist var diacriticsMap. e. Miscellaneous. Version 5.3 (220313) a. Remove requirement doc must be saved. b. When doc is not saved, vars assigned doc.filePath leave empty. c. Warn user when document folder name is empty. d. Variable replacement use RegExp with global flag. Version 5.2 (220304) a. Drop down lists make array third argument instead of in properties object. b. Do not call changeOption() inside validate functions. c. New progress function. d. Settings file UTF-8 encoding. e. i18n file UTF-8 encoding. f. rebuild i18n. Version 5.1 (220110) a. Hoist var settings. b. Function setList/listSelection rename control => uiList c. Function validateNumeric rename control => uiEdit d. Accept decimal comma (only decimal input is Scale). e. Add script variable pageSizeScaleAsFloat. f. Add function valueAsFloat to set pageSizeScaleAsFloat. g. Function valueAsFloat make string before replace. Fixes error 's.replace is not a function'. h. Function valueAsFloat rename argument s => v i. Miscellaneous. Version 5.0 (211223) a. LinkStatus.NORMAL use enumerated value 1852797549. Fixes error 55 object does not support the property or method 'NORMAL' when checking doc.links.status. Version 4.9 (211212) a. Apply settings implement function getProp. b. Apply settings updated setList function. c. Reorder measurement units array to match InDesign. d. Miscellaneous. Version 4.8 (211130) a. Get list selection text property instead of String(list.selection). Version 4.7 (211129) a. Non-code minor edits. b. Replace functions validateFloat and validateInteger with validateNumeric. c. Miscellaneous. Version 4.6 (211115) a. Fix flaw in defining page range. Instead of +1-3 use +1,+2,+3, etc. b. Miscellaneous. c. Clear settings.folderOutputDefault if the folder does not exist. d. Refine exporting loop and how progress is handled. Version 4.5 (211107) a. Add option pages/spreads using drop-down list. b. Change option single/front+back to drop-down list. c. Duplicate pdfPreset because must alter to set pages/spreads. d. Rework code to set page range and skip pages when spreads or backs. e. Add all drop-list text to i18n so can be localized also. f. Move diacritics up to prior line, save vertical space. Version 4.4 (211028) a. Add option recent output folders list and set default. b. Window variables initialize UI before event handlers. c. Window variables make sub-functions variables. d. Miscellaneous. Version 4.3 (211021) a. Rename outputFolder => folderOutput b. Add option save setting include output folder. c. Miscellaneous. d. Numeric values in settings store as strings. e. Page size units value instead of index use string value, i.e. "Inches". Version 4.2 (211017) a. Fix function setList. Version 4.1 (211016) a. New setList function. b. Lists text default from defaultSettings, otherwise empty strings in defaultSettings. c. Setting apply, rework if "fromContent" in o. Version 4.0 (211014) a. Updated settings code. b. Miscellaneous. c. Prefix and suffix don't OR defaultSettings. Could be empty string. d. PDF option group pages single or front+back. Version 3.9 (211001) a. Add format 'PDF (Interactive)'. b. Rename format 'PDF' => 'PDF (Print)'. c. Reorder PDF interactive/print. d. UI adjustments. e. Update i18n. Version 3.8 (210927) a. Update settings load function + other miscellaneous. b. Function changeOption only configureUi if settings not locked. Version 3.7 (210916) a. Settings load/save move file.close() to finally. Version 3.6 (210915) a. (more) UI adjustments (columns). b. Remove support message with email address. Version 3.5 (210914) a. UI adjustments (columns). b. Add include master page option to saved settings. Version 3.4 (210813) a. Error when no images on page, alert rather than throw error. b. Add option include images on master page. c. Add "Include images on master page" to i18n. Version 3.3.1 (210808) a. Optimize loading styles. Version 3.3 (210712) a. Add remove diacritics. b. Remove diacritics directly (do not call a function). c. Resolve special characters current page number and section marker within page content used for name. Version 3.2 (210707) a. Add try/catch to reading graphic.itemLink Otherwise error when graphic inline overset text. b. Solution to null userData in 2.6.1 makes new problem. Some users have MyDocuments on a server. Only use new solution if userData returns null, rather than always. Rather than 'myDocuments', use value for 'desktop'. c. Do not remove non-ascii characters. User wants Unicode preserved. d. Add variable ^X for scale factor. e. Getting appData flaw, !appData won't trigger: it is '/Volumes/null' Version 3.1 (210701) a. Add variables master page and incremental number. Version 3.0.6 (210701) a. Fix bug: styles in groups not working. Need to build and sort arrays of actual styles, not just names. Version 3.0.5 (210624) a. Fix settings pageSizeUnitIndex reverting to default (inches). b. Fix variables window options not triggering changeOption. Version 3.0.4 (210623) a. Settings.add() rename symbol name => inpName Version 3.0.3 (210623) a. File name remove invalid characters. b. Rename function getPageFileName => nameFromContent Version 3.0.2 (210622) a. Setting apply function prefix/suffix use default if undefined. Version 3.0.1 (210620) a. Fix not saving name from content checkbox value. Version 3.0 (210618) a. Fix settings file error userData is null. Use documents and replace path. b. Add options prefix and suffix. c. Add window to describe variables and options for them. d. More prefix/suffix variables. e. Rename function processPageFileName to nameFromContent. f. Prefix/Suffix together on variables window. g. Buttons for variables. h. Replace settings, choose the name of existing settings. i. Fix other glitches in settings. j. Other UI refinements. k. Rename ^+ from Document page number to Absolute page number. l. Load styles include all subgroups. m. Add function sortCi used to sort styles case insensitive. Version 2.6 (210604) a. JPG and PNG add option bleed. b. Fix PNG using JPG resolution. Version 2.5 (210524) a. Add option transform periods. Version 2.4 (210428) a. Internationalization. Version 2.3 (210427) a. Object style get image name. Version 2.2 (210427) a. Add method object style. b. Filter style lists to exclude bracketed items. c. Trim file name to prevent file names only a space character. Version 2.1 (210426) a. Improved error handling and preferences preservation. Version 2.0.2 (210321) a. Alert and confirm supply all arguments. Version 2.0.1 (210303) a. Fix error caused by empty text frames. Version 2.0 (210203) a. Try/catch async PDF export to skip file if already queued. b. Rework process function with following changes: c. Optimize to skip processing page if not selected to export. d. New processPageFileName function. e. Text frames and image links implement stacking order stable sort. f. Process and return name by image before by style. Version 1.1 (210202) a. Paragraph style option reduce matches to first paragraph. b. Include text frames within groups. Prior only top level. Version 1.0 (201012)