Applying style to all TextBoxes in a Grid?
<Style x:Key="InputTBStyle" TargetType="TextBox">
<Setter Property="Background" Value="LightYellow"/>
<Setter Property="Width" Value="100"/>
</Style>
I have defined the style in the Applicatoin.Resource. I could apply the style to each textbox in a grid like so:
<TextBox Style="{DynamicResource InputTBStyle}" x:Name="PdTxtbox" HorizontalAlignment="Left" Height="23" Text="10" Grid.Row="2" Grid.Column="1"/>
But I am looking for a way that I could applying it to all the Textboxes in a Grid in one go (if possible)?
Note: Without sacrificing efficiency and memory.
You could add a style without an x:Key that is based on InputTBStyle to the resources section of the Grid:
<Grid>
<Grid.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource InputTBStyle}"/>
</Grid.Resources>
<TextBox/>
<TextBox/>
</Grid>
Please remember to mark helpful posts as answer and/or helpful.
Similar Messages
-
Applying object style to all objects in a project?
In Cp4, it was possible to change the style of an object and then apply those changes throughout the entire project.
How is this accomplished in Cp5?
I have set up a default style for captions but it seems like I can only change the style of individual captions (one at a time) in the properties of each caption.
Is there a hidden "apply to all" feature in Cp5?
Thank youHello Lilybiri,
I really tried to follow your example but it simply did not work for me.
>Supposing I already have a lot of Text Captions and decide to change their style, which can include font,
>caption style, alignment, colors....
Yes.
>All Text Captions up to that moment did use the Default Caption Style as it was set in
>the Object Style Manager...
>If you want to change object styles for future projects you have to set them in the
>Object Style Manager without any project opened.
This is problem one. I have one standard caption style for all my courses. I have changed the default in the Object Style Manager with and without a project opened. The change simply doesn't stick! Additionally, I have exported a new style to a .cps.
Let me pick through your instructions:
1. First, I open a project.
2. I open the Object Style Manager and notice that the default caption style is back to the original Adobe default (Adobe blue).
3. I import my new caption style. The style is called NewTextCaptionStyle.
4. On the first slide, I select the first text caption (in Adobe Blue).
>I then change one Text Caption to the new style and a + sign appears next to the
>Default Caption Style as you can see in the screenshot.
How do you come to that? The moment I go to the first slide and select the first text caption, it already shows: "+[Default Caption Style]" I have not changed the caption style yet. If I select my desired caption style (NewTextCaptionStyle) from the pull down menu, there is no "+" symbol. I cannot follow this step.
In an attempt to interpret your instructions, I went back to the Object Style Manager and changed the default caption style to what I need.
Okay, now the [Default Caption Style] is exactly what I require.
Back at the first slide, I select the first caption (which is still Adobe Blue). Now, I can follow your first step.
>There are 2 quick ways to proceed now:
>1. If you will not use the original Default Caption Style anymore in this project (it will have no consequences
>for other projects), use the Save icon (yellow highlighted) to save the changes and have a new
>Default Caption Style that will automatically be applied to all Text Captions that are already created and
>new Text Captions will get the same style too.
I will follow your first method.
1. I select the Save icon. [Save Changes to Existing Style]
... it doesn't work. ????
I wonder... the project that I am working with were converted from Cp4 recordings. I wonder if that is causing my grief? -
Applying Style Sheets to all Project Topics
Currently I have topics that use different style sheets (there are 5 listed, although I only created one).
I want all topics to use the same style sheet.
Is there any way to apply a Style to all Project Topics?Welcome to the forum.
Go to the topic list and select all topics, then right click and select Properties. You can assign the new CSS there. Any style names in your topics not included in the new CSS will of course be broken and need to be assigned to whatever style you choose.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
How to apply style sheet (.css) in Weblogic directory listing
Hi,
We are migrating a directory listing application from Apache to Weblogic.
Earlier we did this by Apache httpd.conf entry like below :
<Directory "/opt/apache/httpd-2.1.9/htdocs/Myreportfolder">
IndexOptions FancyIndexing FoldersFirst NameWidth=* XHTML
IndexOrderDefault Descending Date
IndexStyleSheet "/css/style.css"
</Directory>
/opt/apache/httpd-2.1.9/htdocs folder has all it's usual resource files.
We were able to see documents in "Myreportfolder".
Now we have moved to Weblogic and using virtual directory mapping as below and we are trying to achieve the same thing:
<?xml version="1.0" encoding="UTF-8" ?>
- <wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
- <wls:container-descriptor>
<wls:index-directory-enabled>true</wls:index-directory-enabled>
<wls:index-directory-sort-by>LAST_MODIFIED</wls:index-directory-sort-by>
</wls:container-descriptor>
- <wls:virtual-directory-mapping>
<wls:local-path>/Myreportfolder</wls:local-path>
<wls:url-pattern>/*</wls:url-pattern>
</wls:virtual-directory-mapping>
<wls:context-root>/getreports</wls:context-root>
</wls:weblogic-web-app>
We are able to view the reports but we do not get look-and-feel of Apache like directory listing.
but we encounter below issues:
1) File/Folder icons are not visible - we want to use style sheets in http header from the response that is returned from weblogic server
2) Filename is limited to 29 characters when it is showing
3) Files are not sortable as Descending order - we sorted using tag <wls:index-directory-sort-by>LAST_MODIFIED</wls:index-directory-sort-by> but the latest file is shown at the last
We are thinking that Weblogic must be having some configuration like Apache httpd.conf where we can apply style sheets (css ).
We would appreciate af anyone can provide better insight into the issue.
or is it possible to extend weblogic.servlet.fileservlet class to serve this purpose.
Thanks & regards,
RabiHi Vikash,
Check the below links which will you idea on the same.
Stylesheet for WDA without integrating in SAP Portal
Apply custom css to WebDynpro application
Thanks
KH -
How do I apply style within a text frame linked object
I'm selecting the text frame in the object I want to apply an object style
A script can be written
within a text frame the linked object (selected text frame)
how object style is appliedHi
All you need is
app.selection[0].appliedObjectStyle = app.activeDocument.objectStyles.itemByName ("Trevors Object Style");
The below snippet will apply the style to all the anchored objects in the selection or document
var doc = app.properties.activeDocument,
myOnjectStyle = doc.objectStyles.itemByName ("Trevors Object Style"),
myObjects, l;
if (!myOnjectStyle.isValid) {
alert ("Either add an Object Style Called:\nTrevors Object Style\nOr Make Significant Changes to The Script");
quit ();
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.findWhat = "^a";
myObjects = (app.selection && app.selection[0]).findText () || doc.findText ();
l = myObjects.length;
while(l--) myObjects[l].textFrames[0].appliedObjectStyle = myOnjectStyle;
HTH
Trevor -
Shortcut to: Apply (style), Clear Overrides ?
Hi there,
I'm working on a approx 100pg price list that I've set up a tables for, and the design of it has changed slightly (sigh). It looks like a basic excel spreadsheet and I have imported the text already. Basically, I'm going through and applying a cell style to various rows, not equidistant from each other -- some 3 rows apart, some 15. I need to, and have been, highlighting the row, right-clicking the particular cell style, and doing the "Apply (style), Clear Overrides" to get the desired result. So, what I was wondering, Is there ANY way to create a shortcut to do this? I know how to apply the style with a shortcut, but not the overrides option.
Even better, if anyone knows how to select multiple rows at once and apply, that would be fantastic.
Love this forum and thanks in advance!I was just thinking about that cost/benefit analysis on my way to work this morning. If it takes me a whole hour to gin up that script, then how many months before I make those hours back in time saved? My parastyles always have numpad shortcuts (e.g. Control + numpad 8), and my "Clear All Overrides" shortcut is Control + Shift + numpad Enter, so it might be a long, long time before the saved fraction of a second from using a single script instead of two keyboard shortcuts that are right next to one another adds up to the hour of Javascript fumbling.
(Then again, if I cared that much about saving milliseconds, I wouldn't be posting this. ) -
Applying Style1 to all paragraph with Style2
Hi,
I would like to apply a new style to all paragraph with a particular style. For example, change all paragraph with style Style2 to style Style1. How can I proceed?
Thanks for any help.
Hervé Soulard.Kenneth's solution
(1. In a content file, find one of your Style 1 paras.
2. Copy Special > Paragraph Style
3. Use Find&Replace to Find Style 2 and Replace By Pasting. )
... works best for book level replacements.
You can also, for a single file...
In the Paragraph Designer with Style 1 open, use the Global Updates drop down menu to select Style 2 as "Apply to..."
Art -
Hi all,
I am using InDesign CS3 on OS 10.5. I'm trying to write something in Applescript that can look at a document and give me the text that has a certain applied style.
For example, if a document contained the text "Hello, world" and had an applied paragraph style called "Greeting," then what I want is to use my script to tell that document something like this:
tell application "Adobe Indesign CS3"
set theDoc to document 1
set theText to get every paragraph of theDoc whose applied paragraph style is "Greeting"
end tell
theText
-->should return: "Hello, world"
Obviously, I tried that script, but it doesn't work. I get the error "Adobe InDesign CS3 got an error: Cant get every paragraph of document "MyDocument.indd" whose applied paragraph style = "Greeting"."
I'm not sure if I am just using the wrong commands or what. Any help is greatly appreciated!Hi Hayden,
The trouble is, theDoc doesn't have paragraphs. If you open the InDesign dictionary and look at the document object, you'll see text frames, and you'll see stories, but no paragraphs. To get all of the paragraphs, you'd use something like this:
set theText to every paragraph of every story
But getting every paragraph of every story whose applied paragraph style is a specific style is harder to do using a filter ("whose") clause, because it has multiple conditions. Shane can probably do it, but I'm not having much luck. All the same, why bother? InDesign has a perfectly good find text method that will do what you want. Something like this:
tell application "Adobe InDesign CS3"
--Clear the find text preferences
set find text preferences to nothing
set applied paragraph style of find text preferences to paragraph style "Greeting" of document 1
tell document 1
set myFoundItems to find text
end tell
end tell
Thanks,
Ole -
Table styles to all of document?
I have a script (kindly taken from this forum, see below) that applies table/cell styles to a tables you have selected, is there a way to apply this to all tables in the document in one go?
its a basic style, just a header row body content and footer row.
Many thanks.
// using your version; I'd prefer to return 0 if table not found
function findTable(obj) {
while (obj.constructor.name != "Table") {
obj = obj.parent;
if (obj.constructor.name == "Application") {
throw "Can't find table"
return obj
var myTable = 0;
if (app.documents.length > 0 && app.selection.length > 0)
myTable = findTable(app.selection[0]);
// check for at least enough rows for 1 top row, 1 body row, 1 bottom row
if (myTable != 0 && myTable.rows.length >= 3) {
// delete all rules; set insets to 0
myTable.cells.everyItem().appliedCellStyle = "[None]";
// format bottom row
// (remember rows uses 0-based count)
a = myTable.rows.length - 1;
myTable.rows[a].cells.everyItem().appliedCellStyle = "4.cell_body_last";
// format middle rows
first = 1;
last = myTable.rows.length - 2;
for (a = first; a <= last; ++a)
myTable.rows[a].cells.everyItem().appliedCellStyle = "3.cell_body";
// format top row
a = 0;
myTable.rows[a].cells.everyItem().appliedCellStyle = "2.cell_header";(Stepping in for Ram)
It's a bit easier than you think. Ram's code physically selects each table, and that's not even necessary. I'd change his
var myTab = MyDoc.textFrames[i].tables[j];
myTab.select();
YourFunction(); // Call your function here
(which works on a selection) to
myTab = MyDoc.textFrames[i].tables[j];
ProcessOneTable (myTab);
(still using a variable, although that's not really necessary). Then change your code into a function, like this. Remove the lines
var myTable = 0;
if (app.documents.length > 0 && app.selection.length > 0)
myTable = findTable(app.selection[0]);
and replace with
function ProcessOneTable(myTable)
-- and add a closing brace after the very last line. As you can see, the function gets called with a variable "myTable" set to each one of the tables in your current document. The rest should stay unchanged. -
I have a working Pages doc. There is a ton of info in a word doc I need to include. When I copy paste it into Pages, I then can not apply styles from the style drawer. What is that all about? Is there some way to be able to apply styles to info I paste? I dropped word because it displays ridiculous behavior like this. Is pages just as much of a useless time waster? Any help would be appreciated I'm extremely frustrated. Who has time for this kind of annoyance?!?!?!
You have to select the text you want to use a style on.
For more information on Styles download the Pages User Guide. It is downloadable from your Pages Help menu. -
Can I somehow apply styles to subpictures in Encore? Basically, I want to customize the look of text-buttons in three states: normal, selected and activated using styles (eg to make them glow,change stroke color etc) rather then simply change the color of the text.
I also tried to find an option to make a text as text or as button transperent (with a colour stroke style applied so you can actually read it) but couldn't :( Is it at all possible?
Thanks for any adviceIn a word, no.
You may be able to apply styles, but they will be ignored when you preview the menu or build the DVD.
In the DVD-Video format, a subpicture is defined as a 2-bit RLE graphic overlay - one color value, and one opacity value. That means no drop shadows, glows, gradients, etc can be rendered by DVD players for subpicture information.
A color table is used for the subpicture layer that allows you to combine up to three of these 2 bit graphics. Using this color table, you can get a little tricky and use up to three different 2-bit graphics to make the subpicture look a bit more impressive. There's a tutorial on this site that shows how to do that.
But even using this trick, DVD-Video subpictures will never even get close to looking like Photoshop styles on a 32 bit monitor. :)
I don't understand the second part of your post. Can you clarify what it is you are trying to do there? (it seems separate from the styles question) -
How to reference a Textbox or a Grid object from one tile to another tile
Hello All
How do i reference a Textbox of a Grid object from one tile to another tile? I've 6 tiles in a tileset.
Tile-1 has a "Complete" button when that button is clicked i want to loop through a values in a Grid object from Tile-3. Is that possible? I'm using Mobile Application Studio 4.0
Thanks in advance,
HetalHi,
then I would implement sth like the following:
dim myBO as businessobject
dim i as integer, sValue as string
for i = aMyAnchor.bcol.count to 1 step -1
sValue = aMyAnchor.bcol.GetAttribute(i, "myProperty")
if sValue = "" then
aMyAnchor.bcol.item(i).delete
end if
next
Please note that the deletion needs to be done bottom-up because of a refresh of the
indexing after deleting of objects in the collection.
The refresh of the grid is done automatically because of the data binding.
Regards,
Wolfhard -
Create/find tables and apply style
Hello,
I'm very new to scripting. I want to learn the basics like creating a table, creating anchored frames, textframes, etc.
Now, I want to create/find tables in a document and I would like to apply styles. I saw a script to do this. When I paste the script in Extendscript CS4, than the program crash.
The program crash in part 1. When I create another script with only part 2 (see //part 2) then there is no problem.
What do i wrong? And can anyone tell me what part 1 of the script do?
Thanks,
// part 1
// using your version; I'd prefer to return 0 if table not found
function findTable(obj) {
while (obj.constructor.name != "Table") {
obj = obj.parent;
if (obj.constructor.name == "Application") {
throw "Can't find table"
return obj
// part 2
var myTable = 0;
if (app.documents.length > 0 && app.selection.length > 0)
myTable = findTable(app.selection[0]);
// check for at least enough rows for 1 top row, 1 body row, 1 bottom row
if (myTable != 0 && myTable.rows.length >= 3) {
// delete all rules; set insets to 0
myTable.cells.everyItem().appliedCellStyle = "[None]";
// format bottom row
// (remember rows uses 0-based count)
a = myTable.rows.length - 1;
myTable.rows[a].cells.everyItem().appliedCellStyle = "4.cell_body_last";
// format middle rows
first = 1;
last = myTable.rows.length - 2;
for (a = first; a <= last; ++a)
myTable.rows[a].cells.everyItem().appliedCellStyle = "3.cell_body";
// format top row
a = 0;
myTable.rows[a].cells.everyItem().appliedCellStyle = "2.cell_header";Part 1 expects the text cursor to be anywhere inside a table -- either in the regular text, or with a cell, row, column, or the entire table selected.
It walks "up" using its parent until it arrives at the table object itself.
This will only work if the text cursor actually is anywhere inside a table. It does nothing when you are somewhere else, and it only works with the "current" table. -
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 (); -
Applying styles to place assest from AppleScript. CS5.5
We are running a script that based on a csv file, loads various elements from a library then imports XML. An example of these elements might be designed to have 4 separate item records within it and each item record might contain a few text boxes and an image and each of these items have xml tags. To better understand, think of a supermarket circular where they might have 4 meat items in one section with a description, size, price and an image. We've broken it into different sections and based on data coming from our database we can relate to a specific element in our indesign library and know how many items will need to be loaded in that section. This all works fine so far and is pretty cool how it loads but we are looking to maybe pass a basic page theme which might be both object and paragraph styles so we'd like to apply these styles through our script because it is possible that different elements might get different styles in same load or even same elements might be re-used in same load and have different styles so really can't define elements with styles we'd like or associate specific xml tages with styles because might be different in each element.
I can in Applescript apply paragraph and object styles to by either index like applying style x to paragraph 1 but would like to do it to element that we placed on page. Here is an example of our script to maybe better understand. Look for comments where we place our assets(elements) on page. Looking to how we can apply style to say paragraph 1 or text frame 1 of placedAsset says can't get text frame 1 or paragraph 1 of group xxx.
Tried variations of:
tell application "Adobe InDesign CS5.5"
set myDocument to active document
set myPage to active page of active window
set placedAsset to place asset asset "7" of library "GT.indl" on myDocument
move placedAsset to {0.65, 0.6}
tell myDocument
set myStyle to paragraph style "Style1"
set objStyle to object style "objStyle"
--This works for just applying styles by index
tell paragraph 1 of text frame 1
apply paragraph style using myStyle
end tell
tell text frame 1
apply object style using objStyle
end tell
--This gives error described above
tell text frame 1 of placedAsset
apply object style using objStyle
end tell
end tell
end tell
Script which runs now but is not set to apply styles yet:
try
set CSVstr to "Please locate your CSV file..."
set CSV_File to (choose file with prompt CSVstr) as text
set csvData to read file CSV_File
set csvEntries to paragraphs of csvData
tell application "Adobe InDesign CS5.5"
set myDocument to active document
tell XML view preferences
set show attributes to false
set show structure to true
set show tagged frames to false
set show tag markers to false
set show text snippets to true
end tell
tell XML import preferences
set allow transform to false
set create link to XML to false
set ignore unmatched incoming to true
set ignore whitespace to true
set import CALS tables to true
set import style to merge import
set import text into tables to false
set import to selected to false
set remove unmatched existing to false
set repeat text elements to true
end tell
set myPage to active page of active window
set AppleScript's text item delimiters to ","
repeat with i from 1 to count csvEntries
set csvEntry to csvEntries's item i
set {fldElement, fldLocationX, fldLocationY} to csvEntry's text items
-- display dialog fldElement
set placedAsset to place asset asset fldElement of library "GTElements.indl" on myDocument
move placedAsset to {fldLocationX, fldLocationY}
--This is where we'd like to apply styles to placed asset contents. This placed asset will have a few text frames and at
--least one image. We would just pass extra fields in our csv file with names of styles to be applied
end repeat
set AppleScript's text item delimiters to {""}
tell myDocument
set XMLstr to "Please locate your XML file..."
set XML_File to (choose file with prompt XMLstr)
import XML from XML_File
end tell
tell application "Adobe InDesign CS5.5"
set find text preferences to nothing
set change text preferences to nothing
set find what of find text preferences to "mykzlplx"
set change to of change text preferences to ""
tell active document
change text
end tell
set find text preferences to nothing
set change text preferences to nothing
set find what of find text preferences to "Â"
set change to of change text preferences to ""
tell active document
change text
end tell
set find text preferences to nothing
set change text preferences to nothing
end tell
end tell
end tryIt would be a lot easier to help you if you were more succint. You should practice narrowing down the problem to the smallest possible case that demonstrates it. This is a good skill for two reasons: (1) It makes it easier to find the problem yourself (2) It makes it easier for others to help you.
I believe your problem is you are asking for the first textframe of the placed asset:
set placedAsset to place asset asset "7" of library "GT.indl" on myDocument
tell myDocument
--This gives error described above
tell text frame 1 of placedAsset
apply object style using objStyle
end tell
end tell
end tell
At least in JavaScript, the place command returns an array of objects, without regard to type. I suspect that's true in AS as well.
So you probably want something like "tell first item of placedAsset" rather than "text frame 1". And if you want to make sure it is a text frame, because there are other things in the placedAsset, you'll need to use a filter. ("first item of placedAsset whose constructor is textFrame" or something like that).
Again, my applescript is really rusty, but I think that's the general idea.
Maybe you are looking for
-
How to find out the exact version of web server 7.0
Dear all, I am using currently web server 7.0 and in error logs its shows me following version Sun Java System Web Server 7.0 B12/04/2006 10:15 what i need how to find out what exact version i am using in my webserver 7.0 is it update 6 or update 7 o
-
I got an itunes card and it says it wasn't activated properly what do i do
I entered the code and it says it wasnt activated properly what do i do
-
HT204088 Why can't I use Library Search in iTunes?
Why cant I use Library Search in Itunes?
-
Itunes billed me for my netflix renewal...
but whenever i try to acces my netflix account it says they're having problems billing my account. has anyone else had this problem?
-
Mail taking 1.4gb but all mail boxes are empty" Help!
I have clears all my mail boxes but when I check ...settings..general... Usage... It says that mail is using 1.4GB ... How can this be when practically everything's is empty apart from 7 messages with no attachment in the inbox? I'm using hotmail b