Capitalization Script
Is there a capitalization script that can:capitalize only the first letter of each word and not make the rest of the letters lowercase, which is what this seems to do:
event.value = event.value.toLowerCase().replace(/\b\w/g, function(match){return match.toUpperCase();});
My issue is when a name such as "DeWolfe, John" is entered. It is automatically reformatted to "Dewolfe, John".
True, but the overhead is probably not worth it...
On a side note, I don't think it's a good idea to change the way people
choose to enter their names. You should trust your users that they know how
to spell their own names. For example, if someone enters: "Jan de Beer",
maybe they're doing it on purpose and don't want the second word to be
capitalized (because it shouldn't be in their language)...
Similar Messages
-
Set top and bottom inset spacing values in Text Frame Options via jsx script
I am looking for a way to set the top and bottom inset spacing values only to 2 points in Text Frame Options via a .jsx scrpt.
For years, I have used a script that sets Preferences, such as:
with(app.storyPreferences){
opticalMarginAlignment = false;
opticalMarginSize = 12; // pts
I would like to add the code to this same script that would make Top = 0p2 and Bottom 0p2 but leave Left and Right as 0p0.
Any help would be greatly appreciated.Here is the full .jsx file that we now use to set preferences.
Ideally, this could be modified to include setting any text frame created to have 0p2 inset Top and Bottom, but 0p0 Left and Right:
//ApplicationTextDefaults
//An InDesign CS2 JavaScript
//Sets the application text defaults, which will become the text defaults for all
//new documents. Existing documents will remain unchanged.
with(app.textDefaults){
alignToBaseline = false; // align to baseline grid
try {
// appliedFont = app.fonts.item("Times New Roman");
appliedFont = app.fonts.item("Helvetica");
catch (e) {}
try {
fontStyle = "Medium";
catch (e) {}
autoleading = 100;
balanceRaggedLines = false;
baselineShift = 0;
capitalization = Capitalization.normal;
composer = "Adobe Paragraph Composer";
desiredGlyphScaling = 100;
desiredLetterSpacing = 0;
desiredWordSpacing = 100;
dropCapCharacters = 0;
if (dropCapCharacters != 0) {
dropCapLines = 3;
//Assumes that the application has a default character style named "myDropCap"
//dropCapStyle = app.characterStyles.item("myDropCap");
fillColor = app.colors.item("Black");
fillTint = 100;
firstLineIndent = "0pt";
// firstLineIndent = "14pt";
gridAlignFirstLineOnly = false;
horizontalScale = 100;
hyphenateAfterFirst = 3;
hyphenateBeforeLast = 4;
hyphenateCapitalizedWords = false;
hyphenateLadderLimit = 1;
hyphenateWordsLongerThan = 5;
hyphenation = true;
hyphenationZone = "3p";
hyphenWeight = 9;
justification = Justification.leftAlign;
keepAllLinesTogether = false;
keepLinesTogether = true;
keepFirstLines = 2;
keepLastLines = 2;
keepWithNext = 0;
kerningMethod = "Optical";
kerningValue = 0;
leading = 6.3;
// leading = 14;
leftIndent = 0;
ligatures = true;
maximumGlyphScaling = 100;
maximumLetterSpacing = 0;
maximumWordSpacing = 160;
minimumGlyphScaling = 100;
minimumLetterSpacing = 0;
minimumWordSpacing = 80;
noBreak = false;
otfContextualAlternate = true;
otfDiscretionaryLigature = true;
otfFigureStyle = OTFFigureStyle.proportionalOldstyle;
otfFraction = true;
otfHistorical = true;
otfOrdinal = false;
otfSlashedZero = true;
otfSwash = false;
otfTitling = false;
overprintFill = false;
overprintStroke = false;
pointSize = 6.3;
// pointSize = 11;
position = Position.normal;
rightIndent = 0;
ruleAbove = false;
if(ruleAbove == true){
ruleAboveColor = app.colors.item("Black");
ruleAboveGapColor = app.swatches.item("None");
ruleAboveGapOverprint = false;
ruleAboveGapTint = 100;
ruleAboveLeftIndent = 0;
ruleAboveLineWeight = .25;
ruleAboveOffset = 14;
ruleAboveOverprint = false;
ruleAboveRightIndent = 0;
ruleAboveTint = 100;
ruleAboveType = app.strokeStyles.item("Solid");
ruleAboveWidth = RuleWidth.columnWidth;
ruleBelow = false;
if(ruleBelow == true){
ruleBelowColor = app.colors.item("Black");
ruleBelowGapColor = app.swatches.item("None");
ruleBelowGapOverprint = false;
ruleBelowGapTint = 100;
ruleBelowLeftIndent = 0;
ruleBelowLineWeight = .25;
ruleBelowOffset = 0;
ruleBelowOverprint = false;
ruleBelowRightIndent = 0;
ruleBelowTint = 100;
ruleBelowType = app.strokeStyles.item("Solid");
ruleBelowWidth = RuleWidth.columnWidth;
singleWordJustification = SingleWordJustification.leftAlign;
skew = 0;
spaceAfter = 0;
spaceBefore = 0;
startParagraph = StartParagraph.anywhere;
strikeThru = false;
if(strikeThru == true){
strikeThroughColor = app.colors.item("Black");
strikeThroughGapColor = app.swatches.item("None");
strikeThroughGapOverprint = false;
strikeThroughGapTint = 100;
strikeThroughOffset = 3;
strikeThroughOverprint = false;
strikeThroughTint = 100;
strikeThroughType = app.strokeStyles.item("Solid");
strikeThroughWeight = .25;
strokeColor = app.swatches.item("None");
strokeTint = 100;
strokeWeight = 0;
tracking = 0;
underline = false;
if(underline == true){
underlineColor = app.colors.item("Black");
underlineGapColor = app.swatches.item("None");
underlineGapOverprint = false;
underlineGapTint = 100;
underlineOffset = 3;
underlineOverprint = false;
underlineTint = 100;
underlineType = app.strokeStyles.item("Solid");
underlineWeight = .25
verticalScale = 100;
//Units & Increments preference panel
//Must do this to make sure our units that we set are in points. The vert and horiz
//units that get set default to the current measurement unit. We set it to points
//so we can be sure of the value. We'll reset it later to the desired setting.
with(app.viewPreferences){
horizontalMeasurementUnits = MeasurementUnits.points; // Ruler Units, horizontal
verticalMeasurementUnits = MeasurementUnits.points; // Ruler Units, vertical
//General preference panel
with(app.generalPreferences){
pageNumbering = PageNumberingOptions.section; // Page Numbering, View
toolTips = ToolTipOptions.normal; // Tool Tips
// Not supported in CS4
// toolsPalette = ToolsPaletteOptions.doubleColumn; // Floating Tool Palette
completeFontDownloadGlyphLimit = 2000; // Always Subset Fonts...
try {
//Wrapped in try/catch in case it is run with CS4 and earlier to avoid the error
preventSelectingLockedItems = false; // Needed for CS5+
catch (e) {}
//Type preference panel
with (app.textEditingPreferences){
tripleClickSelectsLine = true; // Triple Click to Select a Line
smartCutAndPaste = true; // Adjust Spacing Automatically when Cutting and Pasting Words
dragAndDropTextInLayout = false; // Enable in Layout View
allowDragAndDropTextInStory = true; // Enable in Story Editor
with(app.textPreferences){
typographersQuotes = true; // Use Typographer's Quotes
useOpticalSize = true; // Automatically Use Correct Optical Size
scalingAdjustsText = true; // Adjust Text Attributes when Scaling
useParagraphLeading = false; // Apply Leading to Entire Paragraphs
linkTextFilesWhenImporting = false; // Create Links when Placing Text and Spreadsheet Files
// Missing following (Font Preview Size, Past All Information/Text Only)
//Advanced Type preference panel
with(app.textPreferences){
superscriptSize = 58.3; // Superscript, size
superscriptPosition = 33.3; // Superscript, position
subscriptSize = 58.3; // Subscript, size
subscriptPosition = 33.3; // Subscript, position
smallCap = 70; // Smallcap
with(app.imePreferences){
inlineInput = false; // Use Inline Input for Non-Latin Text
//Composition preference panel
with(app.textPreferences){
highlightKeeps = false; // Keep Violations
highlightHjViolations = false; // H&J Violations
highlightCustomSpacing = false; // Custom Tracking/Kerning
highlightSubstitutedFonts = true; // Substituted Fonts
highlightSubstitutedGlyphs = false; // Substituted Glyphs
justifyTextWraps = false; // Justify Text Next to an Object
abutTextToTextWrap = true; // Skip by Leading
zOrderTextWrap = false; // Text Wrap Only Affects Text Beneath
//Units & Increments preference panel
with(app.viewPreferences){
rulerOrigin = RulerOrigin.spreadOrigin; // Ruler Units, origin
// These are set at the end of the script after all the changes have been made
// horizontalMeasurementUnits = MeasurementUnits.points; // Ruler Units, horizontal
// verticalMeasurementUnits = MeasurementUnits.inches; // Ruler Units, vertical
pointsPerInch = 72; // Point/Pica Size, Points/Inch
cursorKeyIncrement = 1; // Keyboard Increment, Cursor Key
with(app.textPreferences){
baselineShiftKeyIncrement = 2; // Keyboard Increment, Baseline Shift
leadingKeyIncrement = 2; // Keyboard Increment, Size/Leading
kerningKeyIncrement = 20; // Keyboard Increment, Kerning
//Grids preference panel
with(app.gridPreferences){
baselineColor = UIColors.lightBlue; // Baseline Grid, Color
baselineStart = 48; // Baseline Grid, Start
baselineDivision = 6; // Baseline Grid, Increment Every
baselineViewThreshold = 50; // Baseline Grid, View Threshold
baselineGridRelativeOption = BaselineGridRelativeOption.topOfPageOfBaselineGridRelativeOption; // Baseline Grid, Relative To
gridColor = UIColors.lightGray; // Document Grid, Color
horizontalGridlineDivision = 12; // Document Grid, Horizontal, Gridline Every
horizontalGridSubdivision = 12; // Document Grid, Horizontal, Subdivisions
verticalGridlineDivision = 12; // Document Gird, Vertical, Gridline Every
verticalGridSubdivision = 12; // Document Grid, Vertical, Subdivisions
gridsInBack = true; // Grids in Back
documentGridSnapto = false; // snap to grid or not
documentGridShown = false; // show document grid
//Guides & Pasteboard preference panel
with(app.documentPreferences){
marginGuideColor = UIColors.violet; // Color, Margins
columnGuideColor = UIColors.magenta; // Color, Columns
with(app.pasteboardPreferences){
bleedGuideColor = UIColors.fiesta; // Color, Bleed
slugGuideColor = UIColors.gridBlue; // Color, Slug
previewBackgroundColor = UIColors.lightGray; // Color, Preview Background
minimumSpaceAboveAndBelow = 72; // Minimum Vertical Offset
with(app.viewPreferences){
guideSnaptoZone = 4; // Snap to Zone
with(app.guidePreferences){
guidesInBack = false; // Guides in Back
//Dictionary preference panel
with(app.dictionaryPreferences){
composition = ComposeUsing.both; // Hyphenatin Exceptions, Compose Using
mergeUserDictionary = false; // Merge User Dictionary into Document
recomposeWhenChanged = true; // Recompose All Stories When Modified
// Missing (Lang, Hyph, Spelling, Double Quotes, Single Quotes)
//Spelling preference panel
with(app.spellPreferences){
checkMisspelledWords = true; // Find, Misspelled Words
checkRepeatedWords = true; // Find, Repeated Words
checkCapitalizedWords = true; // Find, Uncapitalized Words
checkCapitalizedSentences = true; // Find, Uncapitalized Sentences
dynamicSpellCheck = true; // Enable Dynamic Spelling
misspelledWordColor = UIColors.red; // Color, Misspelled Words
repeatedWordColor = UIColors.green; // Color, Repeated Words
uncapitalizedWordColor = UIColors.green; // Color, Uncapitalized Words
uncapitalizedSentenceColor = UIColors.green; // Color, Uncapitalized Sentences
//Autocorrect preference panel
with(app.autoCorrectPreferences){
autoCorrect = true; // Enable Autocorrect
autoCorrectCapitalizationErrors = false; // Autocorrect Capitalization
// Missing (Language, Misspelled word pairs)
//Display Performance preference panel
with(app.displayPerformancePreferences){
defaultDisplaySettings = ViewDisplaySettings.typical; // Preserve Object-Level
persistLocalSettings = false;
// Missing (antialiasiing, greek below
//Story Editor Display preference panel
with(app.galleyPreferences){
textColor = InCopyUIColors.black; // Text Color
backgroundColor = InCopyUIColors.white; // Background
smoothText = true; // Enable Anti-Aliasing
antiAliasType = AntiAliasType.grayAntialiasing; // Type
cursorType = CursorTypes.standardCursor; // Cursor Type
blinkCursor = true; // Blink
// Missing (Font, Size, Line Spacing & Theme)
//File Handling preference panel
with(app.generalPreferences){
includePreview = true; // Always Save Preview Images with Doc
previewSize = PreviewSizeOptions.medium; // Preview Size
with(app.clipboardPreferences){
preferPDFWhenPasting = false; // Prefer PDF When Pasting
copyPDFToClipboard = true; // Copy PDF to Clipboard
preservePdfClipboardAtQuit = false; // Preserve PDF Data at Quit
// Missing (Enable Version Cue)
// Optical margin (hanging punctuation, outside margins)
with(app.storyPreferences){
opticalMarginAlignment = false;
opticalMarginSize = 12; // pts
//Wrap Up (do at end of script)
//Units & Increments preference panel
//Must do this to make sure our units that we set are in points. The vert and horiz
//units that get set default to the current measurement unit. We set it to points
//so we can be sure of the value. We'll reset it later to the desired setting.
with(app.viewPreferences){
horizontalMeasurementUnits = MeasurementUnits.picas; // Ruler Units, horizontal
verticalMeasurementUnits = MeasurementUnits.inches; // Ruler Units, vertical
// These two flags are turned off to avoid the error message about
// missing image links when InDesign opens an ad. This can especially
// be a problem when doing batch processes.
with(app.linkingPreferences){
checkLinksAtOpen = false; // checkbox: true/false
findMissingLinksAtOpen = false; // checkbox: true/false -
I had a script that worked great for me in Indesign CS. But now does not work in CS4. Anyone knows what needs to be done to make it work again ?
When I drop folder with indesign files on top of this script:
1. opens first page
2. turns specific layer on
3. prints using preset
4. exports using preset
5. close without saving
6. next page
Anyone who can give me solution or idea how this should work is greatly appreciated.
on open sourceFolders
repeat with sourceFolder in sourceFolders
tell application "Finder"
try
-- If you would like to include subfolders, you say - every file of entire contents of folder…
set idFiles to (every file of folder sourceFolder whose file type is "IDd5") as alias list
on error -- work around bug if there is only one file
set idFiles to (every file of folder sourceFolder whose file type is "IDd5") as alias as list
end try
end tell
if idFiles is not {} then
tell application "Adobe InDesign CS4"
set user interaction level to never interact
repeat with i from 1 to count of idFiles
open item i of idFiles
tell document 1
try
set visible of layer "ImagesTag_Layer" to true
end try
set myPreset to "letter size" -- name of print style to use
with timeout of 700 seconds
print using myPreset without print dialog
end timeout
set myPreset1 to "pdf preset name" -- name of pdf export style to use
set myName to the name -- name includes .indd should remove at some point
with timeout of 700 seconds
export format PDF type to "users:temp:Desktop:pdf:" & myName & ".pdf" using myPreset1 without showing options -- set path here format ComputerName:Folder1:Folder2:......:FileName.pdf
end timeout
close without saving
end tell
end repeat
set user interaction level to interact with all
end tell
end if
return 10 -- try again in 10 seconds
end repeat
end open(Disclaimer: me not an AS guy!)
First thing I noticed is the interaction level is set off. If you comment out this line
set user interaction level to never interact
you might be able to pinpoint the exact error -- ID will display a standard "failed" dialog, hopefully showing the line that it fails on.
A quick question: the script assumes two presets in your InDesign: one for print ("letter size") and one for PDFs ("pdf preset name"):
set myPreset to "letter size" -- name of print style to use
set myPreset1 to "pdf preset name" -- name of pdf export style to use
Do these actually exist in your CS4, with the same (non)capitalization and spaces? -
How to Capitalize the First Letter in Every Word in Mysql
Hi,
I have been trying to tidy up a massive database where visitors have been sloppy when entering text. The main thing I want to do is to Capitalize The First Letter In Every Word In Mysql.
I have found the code below in PHP but it keeps finding an error on the WHILE line:
<?php ini_set('display_errors', '1'); ?>
<?php require_once('Connections/maison_connection.php'); ?>
<?php
$result = mysql_query ("SELECT column, id FROM table");
while ($row = mysql_fetch_array($result)) {
$id = $row["id"];
$column2 = ucwords($row["column"]);
$query2 = "UPDATE table SET column = '$column2′ WHERE id = '$id'";
mysql_query($query2);
?>
My table is called MailingList and the Column is called Name, so I have altered the script to this: but it still shows the same WHILE error:
<?php ini_set('display_errors', '1'); ?>
<?php require_once('Connections/maison_connection.php'); ?>
<?php
$result = mysql_query ("SELECT Name, id FROM MailingList");
while ($row = mysql_fetch_array($result)) {
$id = $row["id"];
$Name2 = ucwords($row["Name"]);
$query2 = "UPDATE MailingList SET Name = '$Name2′ WHERE id = '$id'";
mysql_query($query2);
?>
Any ideas??I got it to work this way in SQL: I am SURE there is an abbreviated way to do it, but at least it works
UPDATE MailingList SET Name = replace(Name," a"," A");
UPDATE MailingList SET Name = replace(Name," b"," B");
UPDATE MailingList SET Name = replace(Name," c"," C");
UPDATE MailingList SET Name = replace(Name," d"," D");
UPDATE MailingList SET Name = replace(Name," e"," E");
UPDATE MailingList SET Name = replace(Name," f"," F");
UPDATE MailingList SET Name = replace(Name," g"," G");
UPDATE MailingList SET Name = replace(Name," h"," H");
UPDATE MailingList SET Name = replace(Name," i"," I");
UPDATE MailingList SET Name = replace(Name," j"," J");
UPDATE MailingList SET Name = replace(Name," k"," K");
UPDATE MailingList SET Name = replace(Name," l"," L");
UPDATE MailingList SET Name = replace(Name," m"," M");
UPDATE MailingList SET Name = replace(Name," n"," N");
UPDATE MailingList SET Name = replace(Name," o"," O");
UPDATE MailingList SET Name = replace(Name," p"," P");
UPDATE MailingList SET Name = replace(Name," q"," Q");
UPDATE MailingList SET Name = replace(Name," r"," R");
UPDATE MailingList SET Name = replace(Name," s"," S");
UPDATE MailingList SET Name = replace(Name," t"," T");
UPDATE MailingList SET Name = replace(Name," u"," U");
UPDATE MailingList SET Name = replace(Name," v"," V");
UPDATE MailingList SET Name = replace(Name," w"," W");
UPDATE MailingList SET Name = replace(Name," x"," X");
UPDATE MailingList SET Name = replace(Name," y"," Y");
UPDATE MailingList SET Name = replace(Name," z"," Z"); -
Capitalization errors in iTunes 7.2 Cover Flow view
iTunes 7.2 running under OS X 10.4.9 on MBP. Today I ripped a brand new cd to iTunes and two very strange things happened. One is that after ripping, I downloaded the cover art from iTunes and then decided to erase the downloaded artwork, but it still shows up in Cover Flow view. Nothing shows up for the individual files when I look at them individually with Get Info inside iTunes; there's no artwork shown to delete, yet it's still there in Cover Flow. I deleted the ripped music and emptied the Trash, reripped the cd, did NOT download the new album art, and it was still there in Cover Flow view! How could that possibly happen?
The other weird thing is that the workaround I used to fix capitalization errors in Cover Flow view no longer works. The cd I ripped is titled "Myths and Legends" but I changed it to "Myths And Legends". It shows up correctly on the individual tracks but "And" remains uncapitalized in Cover Flow view. The old workaround was to simply add any new character to the album name, e.g. "MMyths And Legend", apply that change, and then reedit to take out the extra "M". Stubbornly, this no longer works! After taking the extra "M" back out, the "And" remains uncapitalized in Cover Flow view. I think 7.2 introduced a bug that breaks this fix and leaves the original bug in tact. Can anyone verify this?
iMac G4/17" MacBook Pro Mac OS X (10.4.9) 30GB iPod w/videoOver at Dougs:
http://dougscripts.com/itunes/scripts/searchTheScripts.php
You will find a script which fixes all the "cap" issues. Try it on a few for a test. Beware of classical music though as it gets funky with stuff like "EMI", etc. breaks it to "Emi".
Cheers, S. -
Capitalization of DNS via Powershell? How to Change?
Yes - I understand DNS is case insensitive, but when working with a windows/linux environment we have an issue when doing zone transfers in linux.
host -l domain.com produces a variety of results that are have mixed capitalization. We're trying to determine how to rename DNS entries so that they are lowercase.
Is there any way to do it aside from removing a computer and rejoining it to the domain?Not a scripting question. You need to ask in the DNS/Directory Services forum.
There is NO reason to change case on DNS. No web, Windows or Unix system pays attention to case. Unix will but only if you configure it to detect case in dns names. Windows cannot be configured to enforce case.
Unix and Windows web servers can be configured to enforce case in url strings but are not set to do this by default. I have not seen it done for more than ten years.
THe case of names in Indows AD integrated DNS comes from the system names. You would have to rename the systems to fix that. It cannot be done in DNS or in AD.
¯\_(ツ)_/¯ -
How to Create a Script in Greasemonkey?
Hello all, I have a couple of things.
One is a rather chronic problem with scrolling on Tumblr (pages with backgrounds that do not scroll have varying degrees of choppiness/stalling scrolling. Just look at my past questions to see a more detailed description), and the other is a script that fixes the problem (again, see past question replies for the script).
While it is a very small nitpick, I would like to know how to place that script in Greasemonkey, since it is a bit annoying to have to do it manually for every page that requires the script.
I tried looking at Greasemonkey to see if it was something I could do myself, but I decided I would go to those who (might) know, because with my luck I would mess up something crucial.
So...my two questions:
1) How does one make a Greasemonkey script? Or more like, how would one insert an existing script into Greasemonkey?
2) Is there a way to make said script automatically affect only the pages that would need it (for example, only tumblr pages with non-scrolling backgrounds? Since those with no/scrolling backgrounds are fine), or would I need to manually enter in the pages in question as I encountered them?'''Edit: I read too fast. The rule in this thread is for content, and therefore goes into the user<u>Content</u>.css file. Please ignore this post for purposes of the above rule.'''
Here's how to manually create/edit the userChrome.css file:
(1) Find (or create) the chrome folder. This is a folder in your currently active Firefox settings folder, also known as your Firefox profile folder.
* Open the your profile folder using: Help > Troubleshooting Information
** Windows: Click the "Show Folder" button
** Mac: Click the "Show in Finder" button
* Check for a chrome folder.
** If it exists: double-click it to open it.
** If it does not exist: create a chrome folder, then double-click it to open it.
(2) Create or Edit a userChrome.css file by adding your style rule.
''Note: spelling and capitalization are crucial. If Windows does not display file extensions such as .css, .js, .doc, and so forth, change that setting as described in this article: [http://support.microsoft.com/kb/865219].''
* Check for a userChrome.css file in the chrome folder.
** If it exists: open it in a text editor. Check that it has this first line:<br><br>@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);<br><br>Then paste in the new style rule (not duplicating the above line).<br>
** If it does not exist: create a new text file named userChrome.css. (In Windows, right-click and choose New > Text Document and change the name to userChrome.css, making sure the file type ends up being CSS file and not Text Document.) Then see the previous step for what to place in the file.
The rule change should take effect the next time you start Firefox.
Note: I find it easier to use the Stylish extension, but if you don't want yet another extension, then userChrome.css makes the most sense. -
InDesign CS3 script that changes fonts on open
Hello.
I am trying to come up with a script that would change a specific group of fonts, that will always show up missing, to the new font. Basically, it is a bunch of our postscript fonts that are now using our open type font. Below is what I have so far. I want to create a list that goes through about 8 fonts that are old and replace them on the fly with the 8 new fonts. This would be great if I could have this happen on open.
Can anyone see what I have and offer some guidance?
thanks
babs
Open this Scriplet in your Editor:
tell application "Adobe InDesign CS3"
set find text preferences to nothing
set change text preferences to nothing
tell application "Adobe InDesign CS3"
set OLDfont to {"times", "arial"}
set NEWfont to {"times new roman", "helvetica"}
--set find what of find text preferences to testString
tell document 1
repeat with swap from 1 to 2
set NEWfont to item swap of OLDfont
end repeat
end tell
end tell
end tellFor starters, you're going to have to use the correct font names, including correct capitalization. The property you want to change is "applied font", not "find what". And it would probably be more sensible, to go through all paragraph and character styles and make the changes there first, otherwise you'll have troubles again every time you edit stuff.
So start off by getting the name of the font used in every paragraph style, and loop through your list to see if they should be changed. Do the same for character styles. And then do the find/change to find any that have been applied manually. -
Question for scripting gurus: GREP search, change case make Smallcaps
I have no knowledge of scripting at all, but this question keeps coming up during training sessions: is it possible to (java)script this:
- Do a GREP search \u\u+
- Change case to lowercase
- Apply SmallCaps (or: apply character style)
this would allow to search for acronyms and change them to smallcaps (or, even better: apply a character style with small caps and tracking)
I know it is easy for OpenType smallcaps (do a GREP search, change to OT smallcaps) but this doesn't really change case. And some fonts used aren't OT.
Anyone?
Would be VERY apreciated!!But Harbs is a seasoned scripter who knows he'll get flamed if one of his scripts "just does not work" ;)
Well, now that you mention it, the script is not really foolproof. It's a quick and dirty script which I threw together very quickly. It's missing any error checking, some of the variables global, and it's not in a private namespace. These are all things which could cause it to "just not work" ;-)
Here's a more foolproof construct... (and it'll work on the current story if selected, or the whole document if there's no story selected) It will create a new character style if one does not exist and work on character styles within style groups as well. I wrapped the whole script in an anonymous function to give it a unique namespace as well.
(function()
if(app.documents.length==0){return}
var doc=app.documents[0];
// Change the following to your style name!
var character_style_name = 'Small Caps';
try{var range = app.selection[0].parentStory}
catch (err){var range = doc}
//comment out next line if you do not want styles.
var charStyle = GetCharacterStyle(character_style_name,doc);
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat="\\u\\u+";
var finds=range.findGrep();
for (var i=0;i<finds.length;i++){
finds[i].changecase(ChangecaseMode.lowercase);
//comment out next line if you do not want styles.
finds[i].applyCharacterStyle (charStyle)
//uncomment next line if you do not want styles.
//finds[i].capitalization=Capitalization.smallCaps;
function GetCharacterStyle(styleName,doc){
var charStyles=doc.allCharacterStyles;
for(var i=0;i<charStyles.length;i++){
if(charStyles[i].name==styleName){
return charStyles[i];
return doc.characterStyles.add({name:styleName,capitalization:Capitalization.smallCaps}); -
Script: Open all linked docs in *new* window
Can anybody help? I have a pdf document that will need to have 2000+ links to other documents...and I need to have each link open in a *new* window (by default, they open in the exisitng window). We obviously don't want to have to individually set each link's Properties to "open in new window"...
Is there a script I can add to the main (parent) pdf doc to make this happen for all links the user clicks on from the main doc? The kicker is that we can't expect the end user to be able to fool with the Preferences or anything like that...in addition, we assume the user may be viewing in either Acrobat or Acrobat Reader in the corporate environment.
Alternately, a script to automatically show the "previous view" and "next view" arrows, without having the user have to do anything, might work. The absence of those arrows in the default view (starting w Acro 8?) is why we've had to go with the "open in new window" idea. We are dealing with non-tech-savvy users, so we don't want them to have to know keyboard shortcuts or set Preferences...
Thanks so much!!!
BradfordAbsolutely, thanks! I will try to create a variable to store -- and later, restore -- that. Since we have about a zillion links, changing each link would be no fun at all! Is there an issue with trying to evaluate the setting and store the variable from a "on page 1 open" action, and being able to access the variable's value from the "DocumentWillClose" action? (and apologies for any capitalization, etc., issues)
Do I somehow need to declare the variable to be global, or do I need to have the initial actions happen from an "on document open" event? (I don't see such an event as being an available option)...
Any code snippet(s) far a similar situation that you could point me towards...?
Thanks!
Bradford -
I'm looking for a way to replace small caps that are typed as capitals by their normal equivalent.
I've got a text that contains a lot of names which should all be set in small caps.
In fact they are, but because capital letters are used for first letters they don't scale.
Short: I would like to be able to look for A, B, C... (in small caps) and replace them with (a, b, c...) in small caps in one go.
(compare two arrays?? -> is this possible in indesign scripting)Hi,
Actually, it works only with OpenType fonts and - in this case - can be managed by UI find...change feature.
With other type of font we need a real change of contents (another keyboard hit).
It could be done with this code (activeDocument is a target):
-- works for Open Type as well --
// For Latin Basic (ASCII from 65 to 90)
// changes a "cap" letter to a "small" letter
// if Capitalization.SMALL_CAPS is applied to
app.findGrepPreferences = app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\u";
app.findGrepPreferences.capitalization = Capitalization.SMALL_CAPS;
var
mSTART = 65, // ASCII number for "A"
Mstart = 97, // ASCII number for "a"
mDiff = 0,
mTarget = app.activeDocument,
mFound = mTarget.findGrep(),
len = mFound.length, cString;
while (len-->0) {
cString = mFound[len].contents;
mDiff = cString.charCodeAt(0) - mSTART;
if (mDiff > -1 && mDiff < 26)
mFound[len].contents = String.fromCharCode( Mstart + mDiff );
app.findGrepPreferences = app.findGrepPreferences = null;
Jarek -
"Lorem ipsum"-izer script to make your documents make less sense
I made some newspaper mock-ups and needed to change the text of existing pages into lorem-ipsum nonsense, while keeping the formatting and amount of text the same. So I made this scripts. It will change any words in the current selection into nonsense.
It's a bit slow because it loops through every single word in the selection and changes it into latin-sounding words with the same number of characters, and then adds or subtracts some letters to make sure the text is pretty much the same number of lines in the end.
I have only tested it with CS3.
for (var n=0; n<app.selection.length; n++){
loremIpsumize(app.selection[n]);
function loremIpsumize(myText){ // myText could be a TextFrame, Story, InsertionPoint, Word, Text etc...
var loremIpsumDictionary = [[""], // this is the dictionary of words sorted by number of letters. The words are taken from InDesigns "fill with placeholder text"-feature
["a","e","y"],
["el","si","em","se","an","er","do","re","te","at","os","od","to","et","eu","ud","na","ex","ed","ut","ad","il","in","la","it","is","ip","am","ea"],
["ing","lam","vel","lan","lis","lor","ute","ver","con","lum","lut","ibh","del","unt","min","mod","feu","nim","nis","nit","non","nos","bla","eum","eui","num","aut","dio","odo","wis","tis","tio","pis","pit","qui","ate","tin","tie","ese","tet","tem","dip","rat","ero","ril","rit","ros","dit"],
["duis","alit","dunt","ecte","sisi","elis","elit","enim","enis","enit","sent","wisl","erat","amet","tate","alis","erci","erit","wisi","eros","esed","esse","essi","dion","atem","atet","acil","esto","atio","quis","atue","etue","quip","ting","etum","atum","quat","quam","diat","euip","prat"],
["lorem","ispum","magna","ulput","lutem","minci","minis","lummy","commy","adiat","minit","conse","lorer","lorem","ullum","adiam","lobor","modip","modit","lenit","lenim","laore","cipit","molor","utpat","velis","iusto","iusci","iurem","molum","velit","ullan","ullam","nisci"],
["mconse","magnit","mincip","magnis","magnim","minisi","minisl","lutpat","wissis","wissim","acidui","modiat","commod","luptat","wiscip","wiscin","lumsan","wiscil","molent","cinibh","lortio","vulput","molore","lortin","lortie","vullut","vullan","vullam","ncidui","volute","lorper"],
["feuisci","sustrud","ationse","feuisis","feuisit","feuguer","feuismo","feugiat","feummod","feugiam","hendiam","feugait","dolorem","andreet","suscipi","hendrem","hendrer","facipit","heniamc","amconul","atuerat","facipis","dolorer","facinim","tetummy","facinim","delesto"],
["dolortis","vendreet","vullutat","consequi","niatuero","eugiamet","nismodit","adignibh","eugiatet","zzriusto","doluptat","veliquat","nonsecte","veliquam","velestis","dolortio","nonsenim","velessim","dolortin","dolortie","velenibh","nonsequi","veleniat","conullam","eraessit"],
["iriliquis","blandipis","quismolor","irillamet","consequis","iriuscing","blaorerit","iriustrud","etuerosto","nissectet","vendiamet","volestisl","dionsenim","digniamet","eniatisit","quamcommy","iurerosto","ionsequat","ptatueros","consequat","duiscipit","scillummy","veliquisl"],
["loremipsum","exeriurero","nummodolor","ullamcommy","veriliquat","conulputat","uismodolor","exeraessit","exerostrud","nullaortis","tisiscipis","nullaoreet","nullandrem","odigniamet","nullandiat","verciduisi","erciduisit","faciduisim","lummolessi","facincipit","voloreetum"],
["dolortionum","veliquiscil","euguerostie","veliquamcon","aciliquisim","eummolestin","adionsequat","adipsustrud","vercincinis","dolorpercin","exeraestrud","ullaorperit","wismolobore","amconsequis","essequating","facipsustio","doloreetuer","elesequisim","augiametuer"],
["dolutatueros","adigniamcore","velesequipit","adigniscipis","eummolortion","dolorperiure","dolorpercing","ulputpatetue","uipsuscidunt","aliquipsusci","tumsandionse","tionsequisim","facilismolut","facillametum","atueraestrud","sustionsenim","iliquatiniat","dolenismodit"]];
var myStory; // the parent Story of myText
if (myText instanceof Story){
myStory = myText;
} else if (myText instanceof InsertionPoint){
myText = myStory = myText.parentStory;
} else if (myText.hasOwnProperty("parentStory")){ // myText instanceof Word, TextFrame, Character, TextColumn or Paragraph
myStory = myText.parentStory;
} else { // myText is not text, but some other object
return;
if (myText.hasOwnProperty("paragraphs") && !(myText instanceof Paragraph)){ // The script returns better looking results when one Paragraph is processed at a time
var myParagraphs = myText.paragraphs.everyItem().getElements();
for (var n=myParagraphs.length-1; n>=0 ; n--){
loremIpsumize(myParagraphs[n]); // clever recurson
} else if (myText.contents!=""){
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "[\\u\\l'@\u00E6\u00C6]{1,"+loremIpsumDictionary.length+"}"; // only looks for word-characters and leave punctuation, spaces as they are
var storyLineNumber = myStory.lines.length; // remembers how many lines the story has, and tries to make the new text the same number of lines
var myWordMatches = myText.findGrep(); // an array of Word references that fit the grep
for (var i=myWordMatches.length-1; i>=0; i--){
myWordMatches[i].contents = loremipsumWord(myWordMatches[i].contents); // changes the word into a random latin-sounding one
fineTuneText(storyLineNumber);
function fineTuneText(targetNumberOfLines){ // tries to make the text the correct number of lines by adding or subtracting one letter at a time
var myNumberOfCharacters;
var newWord;
var myWord;
while (targetNumberOfLines != myStory.lines.length) {
myNumberOfCharacters = myText.characters.length;
for (var changeWord = myWordMatches.length-1; changeWord>=0; changeWord--){
myWord = myWordMatches[changeWord];
if (targetNumberOfLines>myStory.lines.length){
newWord = loremipsumWord(myWord.contents+"a"); // adds a letter
}else if (targetNumberOfLines<myStory.lines.length){
newWord = myWord.contents.length>1? loremipsumWord(myWord.contents.slice(0,-1)): myWord.contents; // removes a letter
} else {
return true; // targetNumberOfLines == myStory.lines.length
myWord.contents = newWord;
if (myNumberOfCharacters == myText.characters.length){
return false; // Every word in the text has been reduced to a single character, and the text is still too long.... Give up.
} else {
myWordMatches = myText.findGrep(); // Need to do a new search, since the text has been changed
function loremipsumWord(myWord){ // takes a string and returns a random word with same number of letters, and the same capitalization
var replacementWord = "";
var correctCaseWord= "";
var wordLength = myWord.length;
if (wordLength >= loremIpsumDictionary.length){ // in case myWord is longer than the longest words in the dictionary
replacementWord = loremipsumWord(myWord.substr(0,loremIpsumDictionary.length-1))+loremipsumWord(myWord.substr(loremIpsumDictionary.length-1)); // The word is longer than the longest words in the dictionary. So it's split in two.
} else {
replacementWord = loremIpsumDictionary[wordLength][Math.floor(Math.random()*loremIpsumDictionary[wordLength].length)]; // finds a random word of the same length
if (myWord.toLowerCase()!=myWord){ // the word contains uppercase characters
correctCaseWord = "";
for (var n=0; n<wordLength; n++){ // loops through each character in the original word, checking if it's upper or lower case.
correctCaseWord += myWord.charAt(n).toUpperCase()==myWord.charAt(n)? replacementWord.charAt(n).toUpperCase(): replacementWord.charAt(n); // makes the character the correct case
replacementWord = correctCaseWord;
return replacementWord;Thank you Haakenlid, exactly what I needed now.
-
Hello All
We often translate indesign files using a CAT tool to open the idml file. But most of the InDesign files we are sent have been created by people who take a great many short cuts to get things to fit, which maybe good for them but not for us.
We need a script that can set all kerning to 0 or a constant value throughout a document, remove all stretched text and change any thing with ALL CAPS to true uppercase.
There are a few more niggly things we have to do to clean it up which can take a few hours for a large document so it would be good it there was a script that could do this or if anyone knows how to create one for us we would be happy to work with you to create it.Here is a new version:
const kerningConstant = 0;
var doc = app.activeDocument,
stories = doc.stories,
story, text, s, t;
for (var s = 0; s < stories.length; s++) {
story = stories[s];
for (var t = 0; t < story.texts.length; t++) {
text = story.texts[t];
text.kerningValue = kerningConstant;
text.verticalScale = 100;
text.horizontalScale = 100;
ChangeCase(text);
function ChangeCase(text) {
var i, found;
if (text.contents != "") {
app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = ".+";
app.findGrepPreferences.capitalization = Capitalization.ALL_CAPS;
var found = text.findGrep();
if (found.length > 1) {
for (i = 0; i < found.length; i++) {
// $.writeln( i + " - " + found[i].constructor.name + "/"+ found[i].contents );
found[i].changecase(ChangecaseMode.UPPERCASE);
app.changeGrepPreferences.capitalization = Capitalization.NORMAL;
text.changeGrep(); -
How to get certain applied styles using script?
Hi All,
I need to know how to get certain applied styles using ID Scripting. I don't have much experience in InDesign so need some help.
Here is a screenshot with a sample text with the said styles applied and highlighted.
I need to know what texts in my document have these styles applied like All Caps, Strikethrough, Underline, Subscript and Superscript etc.
Please help.
Thanks!Hi Poortip87
The first thing you have to understand is how to refer to "where" you want to apply the style.
If you want the script to apply the style to the selected text then you would use for example app.selection[0].strikeThru = true;
If you for example want to underline the last word of the first paragraph of the first story you would use app.activeDocument.stories[0].paragraphs[0].words[-1].underline = true;
If you just wanted the first letter of that word underlined then you would add .characters[0] after the words[-1]
To for example apply All Caps to all the text in all the stories you would use
app.activeDocument.stories.everyItem().texts[0].capitalization = Capitalization.ALL_CAPS;
The easiest way to find how to set properties to a selections is to set them manually and make the selection and then run the script below.
You should be able to find all the properties you want very easily after running the script.
Or you can use Jongwares excellent reference guide. Indesign JavaScript Help
HTH
Trevor
// script to show most of the selection properties by Trevor
// Creative-Scripts.Com (Still not ready!) available (sometimes) for custom scripts $$$
// scripts {at} Creative-Scripts [dot] Com
$.level = 0; // set debug mode to allow try catch (not read only as stated in manual);
if (!app.selection.length) exit();
var c = 0, s = app.selection[0], p,
a = [], n, er;
for (n in s) {
try {
p = s[n];
if (p && p.constructor.name === "Enumerator") p = getEnum(p ,n);
a[c++] = n + ": " + p;
} catch (er) {a[c++] = n + ": ???"}
var f = new File (Folder.temp + +(new Date) + ".txt");
f.open('r');
f.encoding = "UTF-8";
f.lineFeed = ($.os[0]=="M") ? "Macintosh" :" Windows";
f.open('w');
f.write("\uFEFF" + a.join("\r"));
f.close();
$.sleep(300);
f.execute(true);
function getEnum (q, n) {
var enums = ["AcrobatCompatibility",
"AddPageOptions",
"AdornmentOverprint",
"AlignDistributeBounds",
"AlignOptions",
"AlignmentStyleOptions",
"AlternateGlyphForms",
"AlternatingFillsTypes",
"AnchorPoint",
"AnchorPosition",
"AnchoredRelativeTo",
"AnimationEaseOptions",
"AnimationPlayOperations",
"AntiAliasType",
"ArrangeBy",
"ArrowHead",
"AssetType",
"AssignmentExportOptions",
"AssignmentStatus",
"AutoEnum",
"AutoSizingReferenceEnum",
"AutoSizingTypeEnum",
"BalanceLinesStyle",
"BaselineFrameGridRelativeOption",
"BaselineGridRelativeOption",
"BehaviorEvents",
"BevelAndEmbossDirection",
"BevelAndEmbossStyle",
"BevelAndEmbossTechnique",
"BindingOptions",
"BitmapCompression",
"BlendMode",
"BlendingSpace",
"BookContentStatus",
"BookletTypeOptions",
"BoundingBoxLimits",
"BuildingBlockTypes",
"BulletCharacterType",
"BulletListExportOption",
"Capitalization",
"ChangeBackgroundColorChoices",
"ChangeCaseOptions",
"ChangeConditionsModes",
"ChangeMarkings",
"ChangeTextColorChoices",
"ChangeTypes",
"ChangebarLocations",
"ChangecaseMode",
"ChapterNumberSources",
"CharacterAlignment",
"CharacterCountLocation",
"CharacterDirectionOptions",
"ClippingPathType",
"ColorModel",
"ColorOutputModes",
"ColorRenderingDictionary",
"ColorSettingsPolicy",
"ColorSpace",
"ComposeUsing",
"CompressionQuality",
"ConditionIndicatorMethod",
"ConditionIndicatorMode",
"ConditionUnderlineIndicatorAppearance",
"ContainerType",
"ContentType",
"ContourOptionsTypes",
"ConvertPageBreaks",
"ConvertShapeOptions",
"ConvertTablesOptions",
"CoordinateSpaces",
"CopyrightStatus",
"CornerOptions",
"CreateProxy",
"CrossReferenceType",
"CursorTypes",
"CustomLayoutTypeEnum",
"DataFormat",
"DefaultRenderingIntent",
"DesignOptions",
"DiacriticPositionOptions",
"DigitsTypeOptions",
"DimensionsConstraints",
"DisplayOrderOptions",
"DisplaySettingOptions",
"DistributeOptions",
"DocumentIntentOptions",
"DocumentPrintUiOptions",
"DynamicDocumentsJPEGQualityOptions",
"DynamicDocumentsTextExportPolicy",
"DynamicMediaHandlingOptions",
"DynamicTriggerEvents",
"EPSColorSpace",
"EPSImageData",
"EditingState",
"EmptyFrameFittingOptions",
"EndCap",
"EndJoin",
"EpubCover",
"EpubVersion",
"EventPhases",
"ExportFormat",
"ExportLayerOptions",
"ExportOrder",
"ExportPresetFormat",
"ExportRangeOrAllPages",
"FeatherCornerType",
"FeatherMode",
"FeatureSetOptions",
"FindChangeTransliterateCharacterTypes",
"FirstBaseline",
"FitDimension",
"FitMethodSettings",
"FitOptions",
"Fitting",
"FlattenerLevel",
"Flip",
"FlipValues",
"FloatingWindowPosition",
"FloatingWindowSize",
"FollowShapeModeOptions",
"FontDownloading",
"FontEmbedding",
"FontStatus",
"FontTypes",
"FootnoteFirstBaseline",
"FootnoteMarkerPositioning",
"FootnoteNumberingStyle",
"FootnotePrefixSuffix",
"FootnoteRestarting",
"GIFOptionsPalette",
"GlobalClashResolutionStrategy",
"GlobalClashResolutionStrategyForMasterPage",
"GlowTechnique",
"GoToZoomOptions",
"GradientType",
"GridAlignment",
"GridViewSettings",
"GuideTypeOptions",
"HeaderFooterBreakTypes",
"HeaderTypes",
"HorizontalAlignment",
"HorizontalOrVertical",
"HyperlinkAppearanceHighlight",
"HyperlinkAppearanceStyle",
"HyperlinkAppearanceWidth",
"HyperlinkDestinationPageSetting",
"ICCProfiles",
"IconSizes",
"ImageAlignmentType",
"ImageConversion",
"ImageDataTypes",
"ImageExportOption",
"ImageFormat",
"ImagePageBreakType",
"ImageResolution",
"ImageSizeOption",
"ImportFormat",
"ImportPlatform",
"ImportedPageCropOptions",
"InCopyUIColors",
"IndexCapitalizationOptions",
"IndexFormat",
"InkTypes",
"InnerGlowSource",
"InteractiveElementsOptions",
"InteractivePDFInteractiveElementsOptions",
"JPEGOptionsFormat",
"JPEGOptionsQuality",
"JoinOptions",
"JpegColorSpaceEnum",
"Justification",
"KashidasOptions",
"KentenAlignment",
"KentenCharacter",
"KentenCharacterSet",
"KinsokuHangTypes",
"KinsokuSet",
"KinsokuType",
"LanguageAndRegion",
"LayoutRuleOptions",
"Leading",
"LeadingModel",
"LibraryPanelViews",
"LineAlignment",
"LineSpacingType",
"LinkStatus",
"ListAlignment",
"ListType",
"LiveDrawingOptions",
"Locale",
"LocationOptions",
"LockStateValues",
"MapType",
"MarkLineWeight",
"MarkTypes",
"MatrixContent",
"MeasurementUnits",
"MojikumiTableDefaults",
"MonoBitmapCompression",
"MoviePlayOperations",
"MoviePosterTypes",
"NestedStyleDelimiters",
"NoteBackgrounds",
"NoteColorChoices",
"NothingEnum",
"NumberedListExportOption",
"NumberedParagraphsOptions",
"NumberingStyle",
"OTFFigureStyle",
"ObjectTypes",
"OpenOptions",
"OpenTypeFeature",
"OutlineJoin",
"OverrideType",
"PDFColorSpace",
"PDFCompressionType",
"PDFCrop",
"PDFJPEGQualityOptions",
"PDFMarkWeight",
"PDFProfileSelector",
"PDFRasterCompressionOptions",
"PDFXStandards",
"PNGColorSpaceEnum",
"PNGExportRangeEnum",
"PNGQualityEnum",
"PPDValues",
"PageBindingOptions",
"PageColorOptions",
"PageLayoutOptions",
"PageNumberPosition",
"PageNumberStyle",
"PageNumberingOptions",
"PageOrientation",
"PagePositions",
"PageRange",
"PageReferenceType",
"PageSideOptions",
"PageTransitionDirectionOptions",
"PageTransitionDurationOptions",
"PageTransitionOverrideOptions",
"PageTransitionTypeOptions",
"PageViewOptions",
"PaginationOption",
"PanelLayoutResize",
"PanningTypes",
"PaperSize",
"PaperSizes",
"ParagraphDirectionOptions",
"ParagraphJustificationOptions",
"PathType",
"PathTypeAlignments",
"PdfMagnificationOptions",
"PerformanceMetricOptions",
"PlacedVectorProfilePolicy",
"PlayOperations",
"PointType",
"Position",
"PositionalForms",
"PostScriptLevels",
"PreflightLayerOptions",
"PreflightProfileOptions",
"PreflightRuleFlag",
"PreflightScopeOptions",
"PreviewPagesOptions",
"PreviewSizeOptions",
"PreviewTypes",
"PrintLayerOptions",
"PrintPageOrientation",
"Printer",
"PrinterPresetTypes",
"Profile",
"ProofingType",
"RangeSortOrder",
"RasterCompressionOptions",
"RasterResolutionOptions",
"RecordSelection",
"RecordsPerPage",
"RenderingIntent",
"RepaginateOption",
"ResizeConstraints",
"ResizeMethods",
"ResolveStyleClash",
"RestartPolicy",
"RotationDirection",
"RowTypes",
"RubyAlignments",
"RubyKentenPosition",
"RubyOverhang",
"RubyParentSpacing",
"RubyTypes",
"RuleDataType",
"RuleWidth",
"RulerOrigin",
"SWFBackgroundOptions",
"SWFCurveQualityValue",
"Sampling",
"SaveOptions",
"ScaleModes",
"Screeening",
"ScreenModeOptions",
"ScriptLanguage",
"SearchModes",
"SearchStrategies",
"SelectAll",
"SelectionOptions",
"Sequences",
"ShadowMode",
"SignatureSizeOptions",
"SingleWordJustification",
"SmartMatchOptions",
"SnapshotBlendingModes",
"SortAssets",
"SoundPosterTypes",
"SourceFieldType",
"SourceSpaces",
"SourceType",
"SpanColumnCountOptions",
"SpanColumnTypeOptions",
"SpecialCharacters",
"SpreadFlattenerLevel",
"StartParagraph",
"StateTypes",
"StaticAlignmentOptions",
"StoryDirectionOptions",
"StoryHorizontalOrVertical",
"StoryTypes",
"StrokeAlignment",
"StrokeCornerAdjustment",
"StrokeFillProxyOptions",
"StrokeFillTargetOptions",
"StrokeOrderTypes",
"StyleConflict",
"StyleSheetExportOption",
"SyncConflictResolution",
"TabStopAlignment",
"TableDirectionOptions",
"TableFormattingOptions",
"TagRaster",
"TagTextExportCharacterSet",
"TagTextForm",
"TagTransparency",
"TagType",
"TagVector",
"TaggedPDFStructureOrderOptions",
"TaskAlertType",
"TaskState",
"TextExportCharacterSet",
"TextFrameContents",
"TextImportCharacterSet",
"TextPathEffects",
"TextStrokeAlign",
"TextTypeAlignments",
"TextWrapModes",
"TextWrapSideOptions",
"ThumbsPerPage",
"TilingTypes",
"ToolTipOptions",
"ToolsPanelOptions",
"TrapEndTypes",
"TrapImagePlacementTypes",
"Trapping",
"UIColors",
"UITools",
"UndoModes",
"UpdateLinkOptions",
"UserInteractionLevels",
"VariableNumberingStyles",
"VariableScopes",
"VariableTypes",
"VersionCueSyncStatus",
"VersionState",
"VerticalAlignment",
"VerticalJustification",
"VerticallyRelativeTo",
"ViewDisplaySettings",
"ViewZoomStyle",
"WarichuAlignment",
"WatermarkHorizontalPositionEnum",
"WatermarkVerticalPositionEnum",
"WhenScalingOptions",
"XFLRasterizeFormatOptions",
"XMLElementLocation",
"XMLElementPosition",
"XMLExportUntaggedTablesFormat",
"XMLFileEncoding",
"XMLImportStyles",
"XMLTransformFile",
"ZoomOptions"];
var l = enums.length,
s = q.toString(), e, er, a;
while (l--) {
try {
e = $.global [enums[l]];
if (e.hasOwnProperty (s) && q === e[s]) {
a = e.reflect.properties;
a.pop();
a = (a.length < 2) ? "" : "\r[Possible " + enums[l]+ " Enumerations for " + n + "]:\r" + enums[l] + "." + a.join ("\r" + enums[l] + ".");
return enums[l] + "." + q.toString () + a;
catch (er) {};
return "???." + q.toString (); -
Wonky .jsx Scripts & InD CS5
Are there limitations on number of lines in a javascript? Reason I ask is I have 4 scripts, each containing about 10-15 text conversion lines (abbreviations, spelling changes, capitalization, etc.) that I routinely run on a supplied .txt file after formatting with a smart style. Often, some of each do not work; other times, after applying 3 or 4 or 5 of them, my character styling starts going wonky... lightface characters turning to boldface and vice-versa. The total number of lines in the text block is approximately 550 spread over 6 pages, 2 columns.
See attached dump. Character will randomly change size, change from regular to bold, etc. (The way it's shown is correct.)
Is this a bug in InDesign or a memory problem or what? Any solution?
Running InD CS5 7.0.4 on Lion 10.7.2 on Mac Pro (early 2008), 16G ram
thanks.Are there limitations on number of lines in a javascript?
Not appreciably. Many people regularly run scripts that are thousands of lines long or more without difficulty.
As described it sounds like a bug, in InDesign or in your script. I would add checking to your script to detect the failure condition and try to figure out why it goes wrong, and whittle it down to the smallest reproducible case. (Also, the scripting forum is probably more help than here...)
Maybe you are looking for
-
How can I add a new column in compress partition table.
I have a compress partition table when I add a new column in that table it give me an error "ORA-22856: CANNOT ADD COLUMNS TO OBJECT TABLES". I had cretaed a table in this clause. How can I add a new column in compress partition table. CREATE TABLE E
-
Synchronisation dosen´t work
Hello... I´ve installed the new PC-Suite 6.82.22.0 for the Nokia 6230. Everything works fine (sendig file etc.) but the synchronisation of the calender and contacts doesn´t work. The PC-Suite knows the phone via Bluetooth or USB but after two seconds
-
I created my company logo in pages and saved it as a pdf so it could be easier manipulated. How do I convert or save that pdf as a jpeg? I'm trying to upload the logo into Quickbooks and their software only accepts jpegs.
-
How do I get my apps downloaded to devices after original computer crashed.
my computer crashed and loaded new computer but it will no let me sink apps that I purchased and I cant deautherise the old one.
-
TRANSFER PROJECT FCP FROM G5DUAL TO G4 LAPTOP ?
Hi All. I have finished a small project on FCP HD4.5 using my G5 dual . I want to transfer the project to my g4 laptop to take on a business trip, my scratch disc is a lacie which is coming too. I have tried firewiring the two computers together to t