Save Frame As via Scripting
I want a script to automatically save the current frame in a few different formats to a particular location. The most important formats would be a photoshop file with layers from the comp, and a flat jpeg file.
In the Composition Menu, the Save Frame As feature does everything correctly, it just requires people to manually select a location and filename, which takes time and increases likelihood of user-error (other portions of the script need to find files at particular locations with particular names)
There's apparently a special funciton in Extendscript, saveFrameToPng(), which lets you export a frame and put it exactly where you want it, but it only does .pngs, which can't be read by another application I need to use. I looked around for similar functions that might save to JPEG but couldn't find it.
It seems like there should be a generals solution, that doesn't require me to jump through hoops like:
oldDuration = app.project.items[i].duration
app.project.items[i].duration = 0
app.project.renderQueue.items.add(app.project.items[i])
var index = app.project.renderQueue.items.length
app.project.renderQueue.items[index].outputModules[app.project.renderQueue.items[index].o utputModules.length].file = File(filePath)
app.project.renderQueue.items[index].outputModules[app.project.renderQueue.items[index].o utputModules.length].applyTemplate('Photoshop')
app.project.renderQueue.render()
Folder(folderPath).execute()
app.project.items[i].duration = oldDuration
(The above code doesn't even work quite right, I can think of ways to fix it but it seems like there should be a much more elegant solution I'd rather find)
You are correct, it doesn't. As I mentioned, there's a few problems with that method. It also leaves the timeline set to the "0 duration" and I'm not sure how to reset that so that compositors at my company don't have to keep resizing their timeline. I assumed (hoped?) that there were ways to fix both of those issues. If there's a completely different function I should be using I was going to worry about it. If I do have to worry about I guess I'd also like some explanation of how to change individual RenderQueu item settings, because right now I just know how to set it to pre-existing templates.
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 -
How to find a text in the Frame maker document via script?
How to find a particular text in the Frame maker document via script?
johnsyns wrote:
Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
SQL> select *
2 from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
3 FROM DUAL CONNECT BY ROWNUM <= 27)
4 WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
5 /
no rows selected
SQL> select *
2 from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
3 FROM DUAL CONNECT BY ROWNUM <= 27)
4 WHERE TO_CHAR(dt,'DAY') = 'TUESDAY '
5 /
DT
07-APR-09
14-APR-09
21-APR-09
28-APR-09
SQL> select *
2 from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
3 FROM DUAL CONNECT BY ROWNUM <= 27)
4 WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
5 /
DT
07-APR-09
14-APR-09
21-APR-09
28-APR-09
SQL> SY. -
AE CS6 - Save Frame to Photoshop Error
When attempting to export a single frame for Photoshop via Composition -> Save Frame As... -> File and selecting .PSD as the output type, the render is added to my list using the Output Module: Photoshop.
When I execute the render I get the following error:
After Effects error: Note enough memory to initialize PSL.
(83 :: 8)
This is as a regular user (home system, no domain). However, if I run AE as Administrator, the command works.
I'm running AE CS6 under Windows 7 x64 as part of Creative Cloud install. I have deleted my preferences for AE, and moved the cache to a location where I have full permissions.
Similarly, if I try Composition -> Save Frame As... -> Photoshop Layers AE crashes hard with the following error:
Again, Run as Administrator and it works fine. I have installed the CS apps to my D: drive as C: is a small SSD. Curious if anyone else has seen this issue before.There seems to be an issue with this stuff even in Photoshop itself (or Bridge, to be specific). There's an endlessly long thread on admin privileges being required over in the PS forum. This could be related. Also your second error seems to point to something with audio, so perhaps if you remove whatever audio you use in your project, it may work. Not sure what else to advise...
Mylenium -
Help: apply different para styles to several consecutive paragraphs via script
Hi all,
I need to apply different para styles to several consecutive paragraphs via script, something like this (found somewhere on the net):
var myDoc = app.documents[0];
var mySel = app.selection[0];
var myPStyle1 = "A";
var myPStyle2 = "B";
//need to add 6 more styles here:
//var myPStyle3 = "C";
//var myPStyle4 = "D";
//var myPStyle5 = "E";
//var myPStyle6 = "F";
//var myPStyle7 = "G";
//var myPStyle8 = "H";
//the last style not needed in script?
// apply 1st style to 1st paragraph
mySel.appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle1);
// apply styles to paragraphs after selected
//2nd style
mySel.paragraphs[-1].insertionPoints[-1].appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle2);
//next style
mySel.paragraphs[-1].insertionPoints[-1].paragraphs[0].insertionPoints[-1].appliedParagrap hStyle = myDoc.paragraphStyles.item (myPStyle2).nextStyle;
I've tried badly, but can't find the way to extend the sequence
Sorry, no skills in scripting yet...
all styles have 'Next Style' option activated, but I can't use 'Apply style, then Next style' or Object styles, because I need four different sequences of those para styles:
A-B-C-D-E-F-G-H
A-B-D-E-G-H
A-C-D-F-G-H
A-D-G-H
and I really don't want to create special clones of the same style for each sequence (Keep It Simple, they say ).
I believe it can be done via four slightly adjusted scripts...
any suggestions would be greatly appreciated...Sorry about being late to the party, I usually pick up stuff like this right away.
How about this one?
1. No separate scripts needed, it uses a tiny dialog where you can choose what style set to use. If I'm correct, you can press a number key on Windows to immediately select one of the items.
2. It works down from the paragraph your cursor is in. It has nothing to do with text frames, though -- consecutive paragraphs inside a story always ignore any text frames.
3. Extensible: you can easily change the names of the styles in the top array, and the number of style groups in the list.
var styleLists = [
[ "A", "B", "C", "D", "E", "F", "G", "H" ],
[ "A", "B", "D", "E", "G", "H" ],
[ "A", "C", "D", "F", "G", "H" ],
[ "A", "D", "G", "H" ]
var radiobutts = [];
styleDialog = app.dialogs.add ({name:"Set Multiple Styles",canCancel:true});
with (styleDialog)
with (dialogColumns.add())
with (radiobuttonGroups.add())
for (i=0; i<styleLists.length; i++)
// Build radio button string
str = "&"+String (i+1)+". ";
for (j=0; j<styleLists[i].length; j++)
if (j) str += "-";
str += styleLists[i][j];
radiobutts.push (radiobuttonControls.add({staticLabel:str, checkedState:false}) );
radiobutts[0].checkedState = true;
if (styleDialog.show())
for (i=0; i<radiobutts.length; i++)
if (radiobutts[i].checkedState == true)
break;
if (i < radiobutts.length)
par = app.selection[0].paragraphs[0];
for (j=0; j<styleLists[i].length; j++)
par.appliedParagraphStyle = styleLists[i][j];
par = par.parentStory.paragraphs.nextItem(par); -
Background saving via script? CS6/CC?
Any suggestions out there for getting script to save a file, in the background?
When you have your preferences set ON to Edit > Preferences > File handling > Save In Background, and you save a file by selecting File > SaveAs ... the file saves in the background so you can continue working. Great!
...BUT...
When you do that same action via script... activeDocument.saveAs() I get an annoying progress bar, which inhibits being able to work while the save is running. This makes an autosave script that is supposed to silently run, saving files in the background every few minutes while I work, kinda useless.
Any ideas on how to turn that progress bar dialog off? So Photoshop behaves the same as if I selected SaveAs in the menu??
I Do have app.displayDialogs = DialogModes.NO; but it seems to do no good.
suggestions welcome.Thanks for the reply Davide,
Yes, I've noticed when I run the save process via ANY other way, (regular action run, DOM ExtendScripted, Action Manger scripted, AS3 CS6) - it always has the progress bar.
This just seems to be one of those things that I just can't do automatically the same way as if you just pushed "Cntrl-S". Save in Background - is a great feature. Now if only it could be done through automation... Anyone else have any luck? -
Change medium (e.g. A4,...) via scripting
Hi all,
is it possible to change the medium (e.g. A4, A4color,...) of a form-output via scripting (initialisation) in the LifeCycle Designer?
Thanks a lot.
Regards MarcHi Neelima,
I tried implementing the same in the Save Badi. Still no success.
I guess this is standard bug, I deactivated all my badi implementation and test the standard feature.
I went to the Output tab, by default it was Email and I changed it to XML in the screen.
when i save the PO document . it saved.
But , we opened it again in display or edit mode. It is again defaulted to EMAIL .
Just an information :
Note 1072367 - No output medium identified error even if medium selected.
This note is released with manual correction for SRM_SERVER Ver 6 and say
this is has been included in the SRM_SERVER 7 version.
This piece of correction is not available in our system.
I guess this might be a standard bug ? Please suggest me .
Best regards,
Prabhu -
Update and replace a index via script
Hi everybody,
I created a book with 30 chapters, each of them having a local (or chapter) index at the last pages.
I would like to update these indexes and replace them with the new, updated ones (just as the command "Generate Index..."
do with the option "Replace the Existing Index" on).
I'm able to generate the index via script, but I don't know how to make it replace the existing one.
I dont want the Place the Index, as its precise location is variable and it can run for more than one page and frame.
So even I could get the coordinates of an existing index to place the new one,
I would have the re-layout them, what would defeat my automation goal altogether.
I just want to replace the existing indexes via script, as I can do using the interface.
Is it possible?
Thank you all in advance.
Edson Furman
[email protected]I'd like to re-ask the same question. I am able to generate an index for the first time, but am at a loss how to do the scripting equivalent of pressing the "OK" button in the following dialog:
I'm guessing I should proceed something like this:
myDocument.indexGenerationOptions.replaceExistingIndex = true;
myIndex = myDocument.indexes[0].update();
myIndex.generate( ? DO I REALLY HAVE TO SPECIFY A PAGE ETC. HERE ? ); -
Hi everybody,
I would appreciate if someone could give some clue to sort by name the
Paragraph Styles, Character Styles, Object Styles and Swatches panels
via script.
Thank you all in advance.
Edson Furman
[email protected]For sorting styles I have used the script listed below -- works in CS3 and CS4 though it's been a while since I last tried. It could be coded more elegantly but it always worked fine as it is. It doesn't take into account any style groups -- I don't know what happens if your documents contain any so you'd better not try.
As to swatches, these are not so easy to sort. There was some discussion about this at either of these sites:
http://www.hilfdirselbst.ch/gforum/gforum.cgi?jump=forum%3D4
http://indesign-faq.de/
Peter
#target indesign
sort_par_styles (app.documents[0]);
sort_char_styles (app.documents[0]);
sort_obj_styles (app.documents[0]);
function sort_par_styles (doc)
var string_array = sort_par_names (doc);
for (var i = 0; i < string_array.length; i++)
doc.paragraphStyles.item (string_array[i]).move (
LocationOptions.after, doc.paragraphStyles[i+2])
function sort_par_names (doc)
var array = doc.paragraphStyles.everyItem().name;
array.shift (); array.shift (); // exclude [No p.] and [Basic p/]
return array.sort (case_insensitive);
function sort_char_styles (doc)
var string_array = sort_char_names (doc);
for (var i = 0; i < string_array.length; i++)
doc.characterStyles.item (string_array[i]).move (
LocationOptions.after, doc.characterStyles[i+1])
function sort_char_names (doc)
var array = doc.characterStyles.everyItem().name;
array.shift (); // exclude [None]
return array.sort (case_insensitive);
function sort_obj_styles (doc)
var string_array = sort_obj_names (doc);
for (var i = 0; i < string_array.length; i++)
doc.objectStyles.item (string_array[i]).move (
LocationOptions.after, doc.objectStyles[i+4])
function sort_obj_names (doc)
var array = doc.objectStyles.everyItem().name;
array.shift (); array.shift (); array.shift (); array.shift (); // exclude [None], [Basic Graphics Frame], [Basic Text Frame], [Basic Grid]
return array.sort (case_insensitive);
function case_insensitive (a, b)
return a.toLowerCase() > b.toLowerCase() -
In my project I have to make certain calculation and then get the data plotted in the given report template. I am using automated script for this. My script is doing all the calculations and then it not selecting and drag-dropping the selected channels on the report template. Its saving the blank report template.
I am struggling to get the data for specific channels plotted by using the script. I need the selected channels to be plotted on this report template and then get it saved.
Any help will be deeply appreciated. Thanks
Solved!
Go to Solution.Hi LaxG,
Brad is absolute right. It is possible to create your whole layout via script.
If you have loaded the example report layout you can copy these lines to create a new line in your plot. This is the recommended object oriented way.
call Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Add(e2DShapeLine, "anyName")
Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.XChannel.Reference = "[1]/Zeit"
Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.YChannel.Reference = "[1]/Geschwindigkeit"
For performance reasons it's recommended to use the it like this.
dim oLine
set oLine = Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape
oLine.XChannel.Reference = "[1]/Zeit"
oLine.YChannel.Reference = "[1]/Geschwindigkeit"
Like Brad mentioned it is much easier, that you have a stored template of your report with all setings and customisations already done.
You open this layout file and have stored the names of your calculated channels. When you are doing this with a script they always have the same name and belong to the same group.
Now you can customize the references of the line items.
Kind Regards,
Philipp K.
AE | NI Germany -
Sap script '' how to create table frame in sap script"""
i have some problem in sap script'' how to create table frame in sap script"""
Hi,
you can use BOX command..
Syntax
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
Effect: draws a box of the specified size at the specified position.
Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT and FRAME both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
1. XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
Default: Values specified in the POSITION command.
The following calculation is performed internally to determine the absolute output position of a box on the page:
X(abs) = XORIGIN + XPOS
Y(abs) = YORIGIN + YPOS
2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
4. FRAME: Thickness of frame.
Default: 0 (no frame).
5. INTENSITY: Grayscale of box contents as % .
Default: 100 (full black)
Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
Units of measurement: The following units of measurement may be used:
TW (twip)
PT (point)
IN (inch)
MM (millimeter)
CM (centimeter)
LN (line)
CH (character).
The following conversion factors apply:
1 TW = 1/20 PT
1 PT = 1/72 IN
1 IN = 2.54 CM
1 CM = 10 MM
1 CH = height of a character relative to the CPI specification in the layout set header
1 LN = height of a line relative to the LPI specification in the layout set header
/: BOX FRAME 10 TW
Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
/: BOX INTENSITY 10
Fills the window background with shadowing having a gray scale of 10 %.
/: BOX HEIGHT 0 TW FRAME 10 TW
Draws a horizontal line across the complete top edge of the window.
/: BOX WIDTH 0 TW FRAME 10 TW
Draws a vertical line along the complete height of the left hand edge of the window.
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
check the fallowing link also
http://help.sap.com/saphelp_40b/helpdata/en/d1/803293454211d189710000e8322d00/content.htm
Mark the points if u find it useful...
Regards,
Omkar. -
Is it possible to modify the tag structure tree and the role map via scripting?
We use unstructured FrameMaker to produce training materials which we distribute as tagged PDF to meet accessibility requirements.
When FrameMaker creates a tagged PDF, it does a fairly good job of populating the structure based on the PDF setup information for the paragraph formats in the FrameMaker documents. However, there are some limitations in the support that FrameMaker provides. For example, almost all paragraphs are assigned to the P role even if they are headings and should be mapped to H1-H6.
We want to be able to easily post-process a PDF that has been generated from FrameMaker to fix some of the tag structure issues (including tag names and the role map) so that the PDF will provide the optimum experience for a user of the JAWS screen reader.
I spent some time reading the SDK documentation but didn't find much information about manipulating a tagged PDF via the API, especially via scripting.
Does anyone have any examples or references which explain how to do it?AFAIK, it's not possible with a script. You might want to ask in the SDK forum, as it could be possible with a plugin.
-
One-click 'Save as jpeg' shortcut script please! - saved in the same folder
Hi, I've been re-directed here because I was told a script could solve my problems - but I have no scripting experience/knowledge/ability! Below is my original problem and post. I got as close as 2 button presses, but I'm after that sweet, sweet single-button, double-my-productivity shortcut! Thanks!
http://forums.adobe.com/thread/1106992
I use 'Save as .jpeg' ALL the time (Photoshop CS6, Mac ML), and it really feels like I should just be able to press one button (a shortcut) and the name/quality dialogs don't appear and it just saves a .jpeg into the folder that my original .PSD/file is in.
So basically:
- Press one button to save my open .PSD/file as a .jpeg
- Automatically save it in the same folder as my .PSD
- Save it as '10' quality in the jpeg settings
- No dialog boxes, as soon as I press the button, it saves it - if there's already a .jpeg of the same name, it creates a '-1','-2' etc.
I've tried using 'Actions', but it seems to save it wherever my original Action folder was - it doesn't change to whatever the current folder the .PSD is in...
Thanks!
AdamFile -> Scripts -> Script Events Manager
Click Enable Events at the top
Select Save Document from Photoshop Event drop down
Select Save Extra JPEG from Script drop down
Click Add
Click Done
EVERY document you save, except JPEG files, will save a jpg file. Saving will be slower.
You will need to modify line 62 of the Save Extra JPEG.jsx file located here: <YOUR_PHOTOSHOP_INSTALL_LOCATION>\Presets\Scripts\Event Scripts Only
In order to boost your quality to '10'. Here is the line in question
jpegOptions.quality = 2; // really low
Change it to
jpegOptions.quality = 10; // really high
You will need to modify the script to get this problem solved as well: it saves it - if there's already a .jpeg of the same name, it creates a '-1','-2' etc.
You can steal code out of Image Processor that finds a file name that is unique for the folder so you don't get overwrites.
Are you sure you want that? If you do lots of saves you are going to fill up your disk fast. -
My data source is a daily table on a Web page. In FF 3.16 I click in the table and select File>Save Frame As.... In the Save As dialog box, I key a file name ending in ".txt". The data is saved in a tab-separated text file that I open in Excel.
In FF 5.0.1 File>Save Page As… results in Excel opening a blank sheet.Right-click the frame with that file to get "This Frame" > "Save Frame as"
-
How to determine installed version of EMET via script?
Hi all,
I was not able to find a easy way to determine installed verison of EMET via script. If you can guide me in the right direction, this would help a lot.
Many thanks
SamThis is probably not the right forum for scripting questions and you didn't specify which script you (want to) use... Below you can find some examples...
If you use VBscript you could use WMI and query the class Win32_Product:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product where Name like '%EMET%'")
For Each objSoftware in colSoftware
Wscript.Echo "Name: " & objSoftware.Name
Wscript.Echo "Version: " & objSoftware.Version
Next
This method is not advisable because the class isn't optimized for queries and therefore the query takes a long time!
You can also use the Windows Installer object:
Option Explicit
' Connect to Windows Installer object
Dim installer
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
Dim product, products
Set products = installer.Products
For Each product In products
if instr(1,installer.ProductInfo(product, "InstalledProductName"), "EMET", vbTextCompare) > 0 AND instr(1,installer.ProductInfo(product, "Publisher"), "Microsoft", vbTextCompare) > 0 then
Wscript.Echo installer.ProductInfo(product, "InstalledProductName")
Wscript.Echo installer.ProductInfo(product, "VersionString")
End If
Next
Set products = Nothing
Set installer = Nothing
Wscript.Quit 0
This method enumerates all the products but be aware that you should also check the installstate because the installstate of a product also can be advertised.
You can also use powershell to enumerate the uninstall registry keys but you have take into account that the results may be different on a 64-bit Windows and the bitness of the powershell proces:
gci "hklm:\software\microsoft\windows\currentversion\uninstall" | foreach { gp $_.PSPath } | select DisplayVersion,DisplayName | where { $_.DisplayName -match "^EMET*" }
You can also install and use the
Windows Installer PowerShell Module and use this command:
get-msiproductinfo | where { $_.Name -like '*EMET*' } | select ProductName,ProductVersion | format-list
On the internet you can find a lot of information about your question. For instance I found these pages:
http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/15/use-powershell-to-find-installed-software.aspx
http://blogs.technet.com/b/alexshev/archive/2008/06/30/from-msi-to-wix-part-17-windows-installer-automation-interface-part-2.aspx
W. Spu
Maybe you are looking for
-
Can I convert a new account into my master account?
Hi everyone, first post, thanks for taking the time to look and hopefully answer . So I just bought a new Mac Pro and was thrilled to discover I could use the ol' Migration Assistant to transfer all my crap from my Power Mac AGP. It didn't work in th
-
SL510: Fn Hotkeys not working in Windows 8.1
I upgraded my SL510 with a new SSD and installed Windows 8.1 x64. Now some of my fn keys are not working anymore. For example: fn + Insert (=print) is still working, fn + F5 (=Wifi) is not working anymore. The only possible fix for this I found in my
-
Best practice for speeding up animation...
Hi, What would be best practice for speeding up an animation? - Increase the frame rate, or is that considered cheating (already set to 25)? The alternative would be to manually adjust the length of the tweens on each layer. ~ Let me know what you'd
-
Passing Multiple table row from one view to another view
Hi, How to Passing Multiple table row from one view to another view in Web Dynpro Abap. (Table UI Element) thanx....
-
Dear Experts, What is the <no> in the below syntax ? Where can we get the info for which number is what .. SYSTEM-CALL CONVERT ID <no> I need this info for conversion of Binary data to ASCII. Thanks in advance. Regards, Matt.