Content in new text variable

Hi, I nees some help.
I need to set a number into the new text variable "Number":
I have this code working:
          tell myDoc
                    set txt1 to make new text variable with properties {name:"Number"}
          end tell
How Do i put content in to the text variable?

Hi,
sorry, but I'm not familar with applescript.
But perhaps this Javascript helps you a little bit.
// textVariable.jsx
var aContent = "123";
var tV = app.activeDocument.textVariables.add({name:"number"});
tV.variableOptions.contents = aContent;
Try this and give a feedback please.

Similar Messages

  • How to set the document language based on the contents of a text variable?

    In my Indesign documents, I use a text variable in which I type the abbreviation of the document language according ISO639-1 (e.g. EN, DE, ES, ...). I'd like to have a JavaScript that checks this text variable every time the document is opened and then sets the Language property of my Normal paragraph style, but I don't have any experience with JavaScript.
    Can someone help me please?
    PS: I use InDesign CS5.5.

    Hi Todd,
    I believe ES4 sp1 allows you to do this, but I don't have that version so aren't sure.  I follow the steps described in this blog, LiveCycle Blog: Gesperrte PDF-Eigenschaften in XFA-Formularen ändern//Edit locked PDF properties in XFA forms seems very hacky but does work (the English version comes after the German).
    Regards
    Bruce

  • Portal: how to define new text variables for information broadcasting

    Hello everybody,
    I hope the post here is placed on the right position. If not, please try to advise me, where to ask to get answer on following question:
    -> In BI Portal -> tab Business Intelligence -> Bex Broadcaster -> it is possible to create PDF and post it somewhere into Portal or any other network drive. That's fact. I'm searching for possible enhancement of the F4 help next to the field "data name". There are available only following few variables <OBJECT_ID> <SETTING_ID> <OWNER_ID> <PROCESSED_BY_ID> <LANGUAGE_ID> <DATE_ID> <TIME_ID> <WEEK_ID> <MONTH_ID> <QUARTER_ID> <YEAR_ID>
    We are facing this issue: generated analysis file is valid for the period from month 01 to month actual-1. So therefore I would like to implement my own variable.
    Do you know guys, where to define this own variable with own logic?
    Could you please give me some hints how to create a new one and fill the logic?
    Thank you very much in advance
    Stan

    Not resolved. Life goes still on.

  • Add date to new text file name and generic text in body

    Okay, I hope this is the right forum. To help manage and keep track of incoming assets/files and I created an Automator workflow with the following: "Get Selected Finder Items → Get Folder Contents → New Text File (w/Show this action when the workflow runs so I can give a unique name).
    This creates a text file with the folder contents listed in the body.
    I would like to know if I can do two things:
    1. Automatically add a date/time stamp to the Save as field so it will automatically have a unique file name?
    2. I also want to add text before the listed contents within the text file. (e.g.: Let's say the folder contents are Volumes/Mac HD/Generic_movie.mov. I want the final text to read:
    "The following file has been moved to the local volume at: Volumes/Mac HD/Generic_movie.mov"
    Is there a way to accomplish either one or both of these with Automator or AppleScripts?
    Thanks.

    I would like to know if I can do two things...
    This might address your first concern:
    *1) Get Selected Finder Items*
    *2) Get Folder Contents*
    *3) New Text File* -- select a destination folder and check *Show Action When Run*
    *4) Rename Finder Items:*
    Choose *Add Date or Time* from the popup
    Date/Time: select Created, Modified, or Current - Format: *Month Day Year*
    Where: *After name* - Separator: *Forward Slash*
    Separator: Space - check *Use Leading Zeros* (optional)
    *5) Rename Finder Items:*
    Choose *Add Text* from the popup
    Add: *" at"* -- put a leading space before "at" (without the quotes), and select *after name*.
    *6) Rename Finder Items:*
    Choose *Add Date or Time*
    Date/Time: Current - Format: *Hour Minute Second*
    Where: *After name* - Separator: Dash
    Separator: Space - check *Use Leading Zeros* (strongly recommended)
    +--- End of Workflow ---+
    Save the workflow as an application and use it as a droplet. Drop a desired folder onto the saved applet and enter a name when the dialog appears. The new text file, which will be found in the destination folder, should be appended with a date and time stamp, e.g., *"My Folder List 7/8/2010 at 23-54-09"*
    Tested using Mac OS 10.4.11 and Automator v. 1.0.5
    Good luck; hope this helps.

  • Conflict with text variable on Query Designer

    Hi,
    this is the scenario:
    - On Query Designer i got two restricted key figures: K1 and K2.
    - I'm usign a manual entered variable for 0CALMONTH.
    - On K1 the sales are restricted for the selected month.
    - On K2 the sales are restricted to a range between first month of the year, and the selected month-1.
    Then on a formula i use K1+K2 and a text variable (selected month) for the name of the column. Then, when running the query, the text for the variable can't be found. There is a conflict on text variable when using 2 restricted key figures on the formula.
    How can i solve it ?
    thx

    Hi,
    I assume that your text variable is of replacement type?
    If it doesn't work you can create a new text variable of user exit type and derive its value using entered 0CALMONTH.
    Best regards,
    Eugene

  • Name of column using text variable in Query Designer

    Hello!
    I have 3 columns with amounts, 1 characteristic value variable and 1 text variable.
    For example, names of this columns - 2005 year, 2006 year, 2005/2006.
    I fill names using only one text variable and I can call first 2 column. I use set offset of variables for second column.
    How can I call third column ''2005/2006"?

    Hi,
    u need a second Text varaible and u need to correct your existing text variable.
    Prerequisite: u need for your key figures the same KF-variable
    1. Edit your existing text variable  lets say its called &Text1&
    2. Select your Text variable and go to tab "replacement path"
    3. Choose a) InfoObject b) Choose key
    4. In section "use value range" choose from  value
    5. Create a new text variable lets call it &Text2&
    6. make exact the same settings as for your first text variable butchoose for "value range" to value
    Now u use this text variables for your KF:
    KF 1 -> &Text1&
    KF 2 -> &Text1&
    KF 3 -> &Text1& / &Text2&
    This should make it!!
    Regards
    Tobias

  • News Text is not visible in News iview

    Hi All,
    I have created a news form similat to standard one, but i am able to see the date, author, title, body and readmore link but not abel to see  News text.
    what may be the reason, i want similar functionality as that of standard one.
    is Show form or RenderlistItem which one will be seen in iView
    New iView
    Test News (If click on this another window will open with the below content and News text)
    Date      Administrator
    Test News
    Read More
    Regards,
    Murali
    Edited by: Murali Manohar on May 4, 2008 5:35 AM
    Edited by: Murali Manohar on May 4, 2008 5:50 AM

    Hi Murali,
    Its all depends upon your design of xml forms. Normally you will provide little information in the Renderlist Form like (Title, Image, Date )
    In the Show Form, complete information about the news. For ex: Title, Image, Date, Author, Text, Readmore etc..
    correct me if i am wrong, You probably might not placed "Text" field either in the RenderList Form and Show Form.
    If you've created Schema for "Text" and placed either of the forms then it should show.
    Best Regards,
    Satya

  • Text Variables in Query Title

    I have a requirement in BI to have the Calenday Day/Month display in the Title of my Query.  I know how to do this with Calendar Year and Calendar Year/Month, using TEXT VARIABLES.  However, I was wondering if this was possible using Calenday Day.  And if so, are there any pre-requisites?
    The problem that I have come across is that when I create a new text variable and reference Calenday Year (after choosing replacement path), when I search for a  Calendar Day Variable to use, I don't see them displaying in my choices.  Any help, would be appreciated.

    Hi Maximina,
    if the element is not in your variable list than please close query designer and than open it again.
    Text variables on calendar day works as other text variables.
    If you still cant see it just enter it "directly" in the description field.
    If the name of your variable is "ZDAYTEXT" than write &ZDAYTEXT& in the description.
    Dont use the F4 help. This must work.
    Regards,
    Adem

  • Cannot Get Text Variable to Read Metadata

    Hi,
    I am having an issue loading XMP Metadata into a text variable. I have tried the following procedure on two computers and no result (Windows 7, InDesign 5.0 and 5.5)
    Here is the basic procedure:
    1. Create a new InDesign Document.
    2. Navigate to FILE > FILE INFO
    3. When the XMP data appears, place the word "Test", “Test1”, “Test 2”, and “Test 3” in the Document Title, Author, Author Title, and Description fields and push OK. See Screenshot.
    4. Make a text box.
    5. Place the text insert cursor in the text box then go to the menu and open TYPE> TEXT VARIABLES > DEFINE.
    6. Once the dialog box opens, select NEW...
    7. Name the New Text Variable "Author" and select "METADATA CAPTION" for TYPE: and "AUTHOR" for METADATA: then push OK.
    8. Press the INSERT button to place the new "Author" text variable into the text box.
    Every time I get a <no intersecting link> indication. Can someone help me figure out what I’m doing wrong here?

    Thanks Steve, you are right on. Was hoping that the Metadata information could be absorbed into the file somehow like you can do in MS Word with the document properties for Title, Date, Revision ect. I now will change my plans and I will put the document information on the Title Page and cross-link it to my headers and footers.
    Thanks for the help.

  • Serious problem with text variables in table of contents

    I posted this in the regular InDesign forum -- seems that there's no easy solution that would work well in a production environment (only suggestion was to convert the variables to text). However, thought I'd post it here to see if anyone on the scripting forum has a suggestion that might help:
    Using InDesign CS4, when there is more than one text variable in a heading that is then included in a generated table of contents, the characters in the table of contents entry are scrambled. Is there a way to avoid this problem so that the table of contents entry has the same text as in the heading?

    (This might also have been mentioned in your other thread:)
    Text variables work great, but have one big basic flaw: the text cannot be broken. If you have a single text variable contents that's too wide for your text frame, all characters get squished together. I imagine this being even worse when you have two or more variables in a single paragraph. (Another big flaw is that you cannot include character formatting. Let's hope Adobe is working on it.)
    You cannot "work around" this basic behavior with a script. The only thing you can do is convert the variables to text, which will de-variablize them (for want of a better word).
    Other than using variables, you might want to use the regular Table of Contents feature (which is not "live" but needs updating after each change in the original document text), or perhaps Cross References, which can be used to pick up entire paragraphs.

  • Read from text file to save into mysql db/text variable

    hi
    how do I read from a text file and assign the content to a variable. Cause i want to store the text file in a mysql database.
    any help are greatly appreciated. thanks in advance

    hi
    how do I read from a text file and assign the content to a variable. Cause then i want to store the text file in a mysql database.
    here's how i declared the fileoutputstream....
    FileOutputStream out = new FileOutputStream("D:/FYP/keypair/" + emailID + ".ciphered.asc");
    next is how do I store the content of the text file into a string variable?
    thanks...any help are greatly appreciated...

  • Regarding text variable with replacement path.

    Hi Friends,
    Please can any one tell me good scenario where we can use text variable with replacement path..
    i have already searched in forum,but that scenario's i did not under stand.
    Please send.
    i will assign points.
    Thanks in advance.
    Thanks & Regards,

    Hi,
    There is a scenario:
    One has to show, a Period like May 2008 for a report. i.e the report which u r showing is common for May 2008. So u create a text variable on this Fiscal Year Period. When u do this, the Text appears on the Top of the report. So later, whenever u execute a report for a particular month, u get that Header as Jue, July etc etc.
    Its just a header. Text Variable promts u to display the Header with our own uploaded Desire Data.
    Steps.
    1) Edit your query
    2) Right click 'keyfigures' or other structure, choose 'new selection',
    3) beside description there is 'variable' button, click and then choose 'new', a variable screen will come out, type in your variable name, description, choose 'replacement path' for processing by. click 'next'.
    http://help.sap.com/saphelp_nw04/helpdata/en/ac/789b3c4d4d8d15e10000000a114084/content.htm
    Assign Points if helped
    Thanks
    Edited by: Noor Ahmed khan on Jul 21, 2008 5:43 PM

  • Show the period value in column header using Text Variable

    We are using Posting Period & Financial Year to calculate YTD & MTD, for current year and previous years. These posting period and financial year characteristics are custom created characteristics we are using due to customer specific requirement.
    Input values are posting period, financial year and numeric value. To calculate previous year, I need to subtract numeric value from the input financial year. Every thing is working fine up to this.
    In the report I need to show the posting period and financial year values dynamically in each column header of the report for MTD, YTD for current year & previous year. I tried to achieve this using Text Variables, but I didn’t succeed. If some one can give me some idea to resolve this, it would be very helpful.
    I am excellent in ABAP coding. If you can specify me to code in User Exit, I can do it.
    Column headers should be 08.1999 Sales Qty, 08.2008 Sales Qty, 1999 Sales Qty, 2008 Sales Qty.

    Hi Abhinav,
    Try using the content text variables 0T_FYEAR and 0T_FPER3, when used in the head these variable should display the year and period specified in the RKF.
    e.g
    &0T_FPER3&. &0T_FYEAR& Sales Qty = 08.1999 Sales Qty
    If that doesnt work, try creating text replacement path variables referencing the variables you created for the year and period input. To do this click on the RKF and click on the dropdown by the yellow box next to the description on the general tab and select New Variable, enter the description, tech name and set processng by to Replacment Path, then select period as the ref. characteristic, then on the replacement path tab change replace variable with to variable and then select the variable you are using for the period input, save then hit ok, this is now a text representation of the variable your are inputing for period and can be used in the column headers, you will need to repeat the process for the fiscal year.
    Hope this helps
    Josh

  • How to convert a "text variable" to String with plugin

    Hello,
    I am currently developing a InDesign (CS5) plugin, where I need to manipulate text variable.
    From the plugin I want to convert the "text variable" to string (in principle I should use the method "VariableToString (..)" of "ITextVariable")"
    My problem is, how to find the text varial from its name (I think I should use the method "FindLocationsUsed(..)" of "ITextVariableSuite") and then convert it to String
    I don't know how to use interfaces ITextVariable and ITextVariableSuite
    Plugin implemented in C++ language
    thank you

         InputStreamReader in=new InputStreamReader(fis);
          StringWriter out=new StringWriter();
          char[] buffer=new char[8192];
          int sizeRead;
          while ( ( sizeRead=in.read(buffer, 0, 8192) ) != -1 )
            out.write(buffer, 0, sizeRead);
         String content=out.toString();

  • New Text File Action Does Not Output Correctly (Corrupts)

    I posted this in here by accident. I reposted it in the 10.5 Automator forum...
    I have a simple automator script that uses "Get Specified Text" that contains some arbitrary shell script text, and I pass that to "New Text File" which has the location selected from a variable called "Temporary path" of value "/tmp". The output of 'New Text File" will not contain the text I specified. Here are steps to recreate:
    New automator script
    Get specified text action with the following text:
    #!/bin/sh
    cd "`dirname \"$0\"`"
    if [ true ]; then
    echo 1
    fi
    New variable called "Temporary path" with the value "/tmp"
    New text file action
    --- Save as: test.txt
    --- Where: "Temporary path" (drag Temporary path to the drop down box)
    --- Replace existing file: checked
    I run the script. New text file result shows "/private/tmp/test.txt". Then from the "Terminal" I try to view it ("cat /tmp/test.txt") and the contents are:
    if [ true ]; then\"`"
    fi echo 1
    So the specified text was corrupted. If I create the new file in Desktop or Documents (tried those) it works correctly. What is so special about /tmp? Is there a reason why this shouldn't work?
    Regards,
    John
    Message was edited by: techiejohn

    Alas, my example does work... In hopes of narrowing the problem I tried to narrow the text.
    Anyway below is the full "script" that I'm trying to write to the file that does not work, although if you copy it from here directly, it does work. So to reproduce, I can copy it from here to TextWrangler (that will fix the extra blank lines) then from TextWranger to Automator and the issues remains. The result of "Get specified text" looks correct, but the output still is not.
    <pre>
    #!/bin/bash
    cd "`dirname \"$0\"`"
    clear
    \# display output from a previous run
    if \[ -e "$0".txt \]; then
    cat "$0".txt
    /bin/echo -n "Run again? "
    read run
    if \[ "$run" = "n" -o "$run" = "N" -o "$run" = "no" -o "$run" = "No" -o "$run" = "NO" \]; then
    run=""
    else
    run="Yes"
    fi
    else
    run="Yes"
    fi
    if \[ "$run" \]; then
    date
    echo "Running unison for $USER..."
    if \[ -e "/Users/$USER" -a -e "/Volumes/$USER" \]; then
    /opt/local/bin/unison \
    "/Users/$USER" "/Volumes/$USER" \
    -auto \
    -rsrc false \
    -terse \
    -logfile /dev/null \
    -ignore "Name .DS_Store" \
    -ignore "Name .Spotlight*" \
    -path "Desktop" \
    -path "Documents" \
    -path "Downloads" \
    "$@"
    exit=$?
    case "$exit" in
    0) echo "Successful synchronization; everything is up-to-date now.";;
    1) echo "Some files were skipped, but all file transfers were successful.";;
    2) echo "Non-fatal failures occurred during file transfer.";;
    3) echo "A fatal error occurred, or the execution was interrupted.";;
    esac
    else
    echo "/Users/$USER or /Volumes/$USER does not exist."
    exit=255
    fi
    else
    exit=0
    fi
    \# wait for error acknowledgement
    if \[ "$TERM" -a "$TERM" != "dumb" -a "$exit" -gt 0 \]; then
    /bin/echo -n "Error #$exit; press enter or return to continue: "
    read
    fi
    \# close the terminal window
    termpid=`/opt/local/bin/pstree -p $PPID | grep Terminal.app | grep -v grep | awk '{print $2}'`
    if \[ "$termpid" \]; then
    kill "$termpid"
    fi
    exit $exit
    </pre>

Maybe you are looking for