Setting shadow with Javascript

For some odd reason, none of the Indesign's VBA-scripts works with InDesign CS5 anymore, maybe then reason is Office 2010 64-bit.
Anyway, Javascript works just fine, but I'm having difficulties to write following script with JavaScript. Can anybody help?
Simply script by setting up drop shadow for an active object.
Set myInDesign = CreateObject("InDesign.Application")
Set myObject = myInDesign.Selection.Item(1)
myObject.transparencySettings.dropShadowSettings.angle=135
myObject.transparencySettings.dropShadowSettings.opacity=33
myObject.transparencySettings.dropShadowSettings.distance=1
myObject.transparencySettings.dropShadowSettings.mode=2020623440
myObject.transparencySettings.dropShadowSettings.blendMode=1852797549

Hey!
Here is the same code in JavaScript:
var myObject = app.selection[0];
with(myObject.transparencySettings.dropShadowSettings){
    angle = 135;
    opacity = 33;
    distance = 1;
    mode = ShadowMode.DROP;
    blendMode = BlendMode.NORMAL;
Hope that helps.
tomaxxi
http://indisnip.wordpress.com/
http://inditip.wordpress.com/

Similar Messages

  • Setting styles with javascript

    getelementby('id').setAttribute lets you change a HTML objects attributes
    However the style attirubute (getelementby('id').setAttribute("style","value goes here")); actually contatins many settings in what javacript sees as a single attribute.
    as a result everytime i change a style setting with this i have to re-insert all of the other styles.
    this is inconvinient at best.
    and at worst means i have to store all of the set styles as javascript attributes and re-insert the whole lot.
    is there another way of doing this
    so that i can add or delete styles without the rest of the set styles being affected?

    function(){return A.apply(null,[this].concat($A(arguments)))}
    I_Know_Nothing_at_all wrote:
    I'm confused. Are you using the getElementby to write or set an individual style for multiple elements all over a page?
    I use it to set a style for an element or elements where the style is dependant on some other factor, or has to be changed in responce to an event.
    CSS alone cant do this because it does not have event listenters (except for psudo events such as :hover) cannot detect the styles and setting of anything (except for media rules) and does not have any sort of evaluative functions such as IFs, CASEs and basic arithmetic.

  • Set Date With Javascript

    I have 2 date fields, A and B.
    What I need to do is once I tab out of A, I need to set B to A+1year-1day.
    I can do this in a page process on submit with
    ADD_MONTHS(:P_A, 12)-1
    but I need this to be done on change of field A.
    Any help appreciated
    Gus

    Hi Gus,
    you need to provide the date format you are using.
    Add this to your FIELD A "html form element attributes":
    onblur="javascript:fnc_field_b(this)"Add this to your page header:
    <script>
    function fnc_field_b(v_field_a){
    /* Input: mm/dd/yyyy */
    /* Output: dd.mm.yyyy */
    /* Documentation: http://www.javascriptkata.com/2007/04/27/mastering-of-the-date-object-in-javascript/ */
    /*                http://programming.top54u.com/post/Javascript-Convert-String-to-Date.aspx            */
    /* Create date object */
    var myDate = new Date(v_field_a.value);
    /* Add 1 year */
    myDate.setDate(myDate.getDate() + 365);
    /* Create output string DD.MM.YYYY */
    /* Day */
    var myStr = (myDate.getDate() < 10 ? "0" + myDate.getDate().toString() : myDate.getDate().toString()) +  ".";
    /* Month */
        myStr = myStr + (myDate.getMonth()+1 < 10 ? "0" + (myDate.getMonth()+1).toString() : (myDate.getMonth()+1).toString()) + ".";
    /* Year */
        myStr = myStr + myDate.getFullYear().toString();
    /* Set value */
    $s('P1_FIELD_B',myStr);
    &lt;/script>Change the field P1_FIELD_B to the name of your field B name.
    Best regards,
    Tobias
    Edited by: Tobias Arnhold on Mar 7, 2011 4:44 PM

  • Printing PDF attachments with Javascript?

    I am very new to Javascript (and not a programmer) so please excuse my basic or un-correct terminology here! I've created an interactive pdf, and have set buttons (with javascript code) to print specific ranges of pages from the document. I've now been asked to have said buttons print attachments (which are also pdf's) in the same style... is this possible, and if so, does anyone have example code? The code that I used to print the page ranges, for example:
    print ({nStart: 0, nEnd: 5});
    Any assistance/guidance/help would be greatly appreciated!

    The document first has to be opened. You can do this via JavaScript with the doc.openDataObject method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.509.html
    This method returns a doc object, which you can use with the print method to print the document. You should then use the closeDoc method to close the document, as mentioned in and demonstrated in the documentation linked to above.

  • Setting User Preferences With Javascript In Acrobat X

    Hi All,
    Is there a way thru Javascript to programatically set a value in the User Preferences?
    I am trying to create a batch sequence that exports PDFs to HTMLs. In the Acrobat X preferences, there is a conversion option that sets the option of "Run OCR If Needed" to true or false.
    Edit --> Preferences --> Convert From PDF --> HTML --> Run OCR if needed (True|False)
    Depending on conditions, I need to programtically set the value of this preference during the batch sequence before I export the document to HTML. Is this possible? Any help would be greatly appreaciated.
    Thank you,
    Teri

    There are very few user preferences that can be controlled with JavaScript, and this isn't one of them.

  • Dynamically set y axis (position) with javascript

    Hello
    I wonder if it is possible with javascript to set a y position of flowed subform in non interactive adobe form?
    For example: For a certain subform  which is inclued in (flowed) main I want to be shown at certain vertical (y) position but only in the last page at bottom of main.
    Last page I can find with
    if(xfa.layout.page(this) == xfa.layout.pageCount())
    but when changing
    this.y = "100 mm"
    it doesn't changes subform position.
    I also tried with this.y = "100in", but result is the same.
    Does anybody now a solution?

    It's not a field, it's a complete subform with a table and some texts fields, which I want to show only in last page.
    I tried changing subform to a positioned already before and changing it's y axis in javascript (tried in all events) doesn't work.
    Could it be that syntax posted in first post isn't correct?
    In that case (positioned subform) I have blank space on all pages but last one. For example, if a complete layout of a page is 100%, main 70% and subform 30%, I get 30% of blank space on all pages before last one, which I would like to avoid, so that main would be 100% in every page but last one and in the last one main should be only 70% and subform 30%.

  • Open and Close Popup With Javascript

    Using Apex 3.2
    I have probably done this loads of times in my old job, but do not have access to the code and today I just can't get it to work properly.
    I have opened a pop up window with javascript
    Now I need to close it and refresh the calling page, but only if it passes the validation on the popup.
    I have a hidden item on my pop up called P7_FLAG.
    I have a page process after validation that sets P7_FLAG to (only set to 1, if passes validation).
    I also have a SUBMIT button.
    So once I click my SUBMIT button the page should look at the validations, if ok, set P7_FLAG to 1, then close the popup and refresh the calling page.
    My current javascript look like this
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>On my button
    javascript:saveChanges();The problem is that I need to click the SUBMIT button twice.
    First time it sets P7_FLAG
    Second time it closes page and refreshes.
    I have probably made some basic error, but today I cannot see it.
    Cheers
    Gus
    Edited by: Gus C on May 10, 2012 12:48 AM

    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>javascript does not wait for the current action to complete and then perform the next line.
    means in your function call
    doSubmit('SUBMIT');is triggered and it carry on's to next line that is
    $x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
    what you need to do is amend your js function like below
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    </script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
    and set the branch source to below
    htp.p('window.close();');
    htp.p('window.opener.doSubmit(''REFRESH'');');

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • The combination of report with javascript

    Hi guys,
    I want to use report combined with javascript as follows:
    <APPLET NAME="ASMGridAppAssembly" ...
    PARAM NAME="QueryTemplate" VALUE="..../Reports/PTSD/AsmNCMFRXQuery">
    <PARAM NAME="DisplayTemplate" VALUE=".../Reports/AsmGrid">
    <param name="Param.1" value=>
    <param name="Param.2" value=>
    </APPLET>
    document.ASMGridAppAssembly.getQueryObject().setParam(3,Param3);
    document.ASMGridAppAssembly.getQueryObject().setParam(4,Param4);
    Can I achieve this?
    Thanks,
    Tony.
    Edited by: Tony Hu on Aug 8, 2008 7:07 PM

    Mike - Huh?  If javascript is called to an active applet on the page that received Param.1 and Param.2 through param overrides in the html (like shown in Tony's post) they will absolutely override any static ones that are in the query template itself.
    Tony - you need to instruct the applet to run the query with your 2 new parameters, so add this line after setting param 3 and 4:
    document.ASMGridAppAssembly.updateGrid(true);
    Regards,
    Jeremy

  • XML IDOC post to R/3 Via WAS - want to see error content with JavaScript

    Hi,
    I am posting XML IDOCs to our R/3 system via a webpage that I have built with JavaScript.  I am posting to the WAS, which is configured to read the XML IDOC with SAP's standard class handler CL_HTTP_IDOC_XML_REQUEST.  We are on basis 620 support pack SAPKB62041.
    In my webpage, I have the JavaScript code set to read the status and statusText so I can see the response from WAS when I post my XML IDOC.  However, I am getting back very generic information when I encounter a 409 error.  THe statusText is always "input_not_found".  So I debugged the class handler code and found that SAP is returning back the more descriptive error info in HTML format.
    I ran a packet sniffer to see what WAS returns and the info looks like this:
    <html><head><title>IDoc-XML-inbound not ok</title><h1>IDoc-XML-inbound not ok</h1></head><body>
    E:Table Lookup Error:300 Cannot map value for field MESCOD in table ZFI_IF_IDOCORG using values
    SNDSAD = |TE|  and RCVLAD = |GL|  and MESTYP = |ACC_DOCUMENT|</body></html>
    I want to know how I can get my webpage to read this HTML info and store that into an alert so I can read this text that I'm returning back to the HTTP post.
    This is how my script looks.  I'm using IE6.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Test XML</title>
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--
    function XMLHTTPButton_onclick(DataToSend) {
         var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         xmlhttp.Open("POST","http://some_server:1089/sap/bc/zxml_idoc?sap-client=200&sap-language=EN",false);
         xmlhttp.setRequestHeader("Content-Type", "text/xml");
         xmlhttp.send(DataToSend);
            alert(xmlhttp.Status);
            alert(xmlhttp.statusText);
         alert(xmlhttp.responseXML.xml);
    //-->
    </SCRIPT>
    </head>
    <body>
    <BR>
    This page posts to
    <BR>
    http://some_server:1089/sap/bc/zxml_idoc?sap-client=200&sap-language=EN
    <FORM name=xmlform method=post >
    <P><TEXTAREA style="WIDTH: 623px; HEIGHT: 369px" name=xmlData rows=23 cols=77>
    </TEXTAREA>
    <P>
    <INPUT type="button" value="Submit XMLHTTP" id=XMLHTTPButton name=XMLHTTPButton
    LANGUAGE=javascript onclick="return XMLHTTPButton_onclick(document.xmlform.xmlData.value)">
    </form>
    Previously with this class handler, SAP returned the detailed info back to the "alert(xmlhttp.statusText)" and I had no problem seeing the return info.  But now they have decided to format it in HTML and I don't know how to view this text since it has no ID on it to pull this into an alert box.
    If anyone has any ideas, please let me know.
    Thanks,
    Andrea

    Ok!
    I have solve the problem. So, I was trying to connect via SSO within an user that was not registered in R/3 and I forgot it.
    Sorry for the inconvenience.

  • C# control event handling with javascript

    How can I get javascript to execute for "onchange" / "OnSelectedIndexChanged" event instead of a CodeBehind method? I think "OnSelectedIndexChanged" event has to be handled by CodeBehind; but how can I replace that (or onchange) with
    a javascript event handler?
    I have the following in my xyz.ascx file:
    <asp:DropDownList ID="ddlTypeCar" CssClass="BatsRefAddressTypes" runat="server"
                      onchange="javascript: testAlert();"
                      OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged"
                      AutoPostBack="True" />
    I could not get the javascript to execute, even though I removed OnSelectedIndexChanged="ddlTypeCar_SelectedIndexChanged" and/or set AutoPostBack="false".
    Additionally, I tried added the following in xyz.ascx.cs Page_Load() method.
    ddlTypeOfAddress.Attributes.Add("onchange", "javascript: testAlert();");
    which didn't help.
    Thanks for your help in advance.

    Hi,
    you can control client events instead of server events with javascript
    look this url for more information
    http://www.w3schools.com/js/js_events.asp
    Regards

  • How can I create drop shadows with PSE10

    How can I create drop shadows with PSE10 & PE10?

    Layer styles let you quickly apply effects to an entire layer. In the Effects panel, you can view a variety of predefined layer styles and apply a style with just a click of the mouse.
    Three different layer styles applied to text 
    The boundaries of the effect are automatically updated when you edit that layer. For example, if you apply a drop shadow style to a text layer, the shadow changes automatically when you edit the text.
    Layer styles are cumulative, which means that you can create a complex effect by applying multiple styles to a layer. You can apply one style from each style library per layer. You can also change a layer’s style settings to adjust the final result.
    When you apply a style to a layer, a style icon appears to the right of the layer’s name in the Layers panel. Layer styles are linked to the layer contents. When you move or edit the contents of the layer, the effects are modified correspondingly.
    Once you choose Layer > Layer Style > Style Settings, you can edit the settings of a layer’s style or apply other style settings or attributes available in the dialog box.
    Lighting Angle Specifies the lighting angle at which the effect is applied to the layer.
    Drop Shadow
    Specifies the distance of a drop shadow from the layer’s content. You can also set the size and opacity with the sliders.
    Outer Glow Size Specifies the size of a glow that emanates from the outside edges of the layer’s content. You can also set the opacity with the slider.
    Inner Glow Size Specifies the size of a glow that emanates from the inside edges of the layer’s content. You can also set the opacity with the slider.
    Bevel Size Specifies the size of beveling along the inside edges of the layer’s content.
    Bevel Direction Specifies the direction of the bevel, either up or down.
    Stroke Size Specifies the size of the stroke.
    Stroke Opacity Specifies the opacity of the stroke.

  • Formatting Date with JavaScript

    Hello guys,
    is there a way to change the date format with JavaScript? I have a library with different fields.
    I hope you can help me!
    Best regards
    Matthias

    Yes
    Check below
    http://www.bentedder.com/convert-a-sharepoint-datetime-field-to-a-javascript-date-object/
    function convertSPDate(d) {
    * A function to convert a standard SharePoint
    * date/time field (YYYY-MM-DD HH:MM:SS) to a
    * javascript Date() object
    * Author: Ben Tedder (www.bentedder.com)
    // split apart the date and time
    var xDate = d.split(" ")[0];
    var xTime = d.split(" ")[1];
    // split apart the hour, minute, & second
    var xTimeParts = xTime.split(":");
    var xHour = xTimeParts[0];
    var xMin = xTimeParts[1];
    var xSec = xTimeParts[2];
    // split apart the year, month, & day
    var xDateParts = xDate.split("-");
    var xYear = xDateParts[0];
    var xMonth = xDateParts[1];
    var xDay = xDateParts[2];
    var dDate = new Date(xYear, xMonth, xDay, xHour, xMin, xSec);
    return dDate;
    // create a couple of variables
    var startTime;
    var convertedStartTime;
    // a standard SPServices call
    $().SPServices({
    operation: "GetListItems",
    webURL: myListURL,
    async:false,
    listName: myListName,
    CAMLRowLimit: 1,
    completefunc: function (xData, Status) {
    $(xData.responseXML).SPFilterNode("z:row").each(function(i){
    // set the value of startTime to standard SP date/time field
    startTime = $(this).attr("ows_startTime");
    // set the convertedStartTime to a true javascript date
    convertedStartTime = convertSPDate(startTime);
    http://spservices.codeplex.com/wikipage?title=$%28%29.SPServices.SPConvertDateToISO
    http://stackoverflow.com/questions/14283106/beginner-javascript-date-conversion-from-string-to-utc-date-js-into-sharepoint
    http://stackoverflow.com/questions/14742625/how-to-convert-utc-date-by-javascript

  • Setting preferences with script

    I want to distribute adobe reader on a terminal server and restrict the users from changing the configuration.  I need to uncheck the "open cross-documents links in same window".  I'm hoping to do this with Javascript. 
    Does anyone know how to do this?
    Thanks,
    Jeff

    Thanks Michael but I don't know how to use an installer for this, nor do I know what registry setting would need to be changed.  I am using Windows Server 2008 SP2
    Since this will be access through Terminal Server (RDP), it will only be installed once on the server and accessed by multiple users.  I thought that once I changed the setting, it would be effective for all new users but that doesn't seem to be the case.  I've tried using a shared profile but that doesn't do it, either.
    Anyone have any other ideas?
    Jeff

  • What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API

    The question says it all:
    What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API.?
    In the User Profile -> Permissions there is only the option for "Full Control".

    Hi Nikolay,
    Thanks for posting your issue, you need to set permissions on User Profiles = Read. Kindly find the below mentioned URLs to get the code and more details on this.
    http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    http://sharepoint.stackexchange.com/questions/61714/sharepoint-2013-call-the-rest-api-from-sharepoint-hosted-app
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

Maybe you are looking for