Created
December 18, 2025 13:57
-
-
Save somahargitai/b0ba25970d055abaf9a7855b5ca585bf to your computer and use it in GitHub Desktop.
Select all cursive texts in indesign
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
| #target indesign | |
| var doc = app.activeDocument; | |
| app.select(NothingEnum.NOTHING); | |
| var foundItems = []; | |
| for (var i = 0; i < doc.stories.length; i++) { | |
| var story = doc.stories[i]; | |
| var chars = story.characters; | |
| for (var j = 0; j < chars.length; j++) { | |
| try { | |
| var ch = chars[j]; | |
| var fontStyle = ch.fontStyle; | |
| if ( | |
| fontStyle && | |
| ( | |
| fontStyle.match(/italic/i) || | |
| fontStyle.match(/oblique/i) || | |
| fontStyle.match(/kursiv/i) | |
| ) | |
| ) { | |
| foundItems.push(ch); | |
| } | |
| } catch (e) {} | |
| } | |
| } | |
| if (foundItems.length > 0) { | |
| app.select(foundItems); | |
| alert(foundItems.length + " kurzív karakter kijelölve."); | |
| } else { | |
| alert("Nem találtam kurzív szöveget."); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment