count the words in a text widget

Hello

Is there a way I can count the number of words in a text box widget?  I realize that means counting the number of words in the attached variable - but can I do this?

I tried to play with Javascript (which I know nothing)

I put the following script in the script for a button pane, but nothing seems to happen!

Test = Q5WidgetAnswer.Split (""). Length-1;

document. Write (test);

I want to check three words in a response, and if there are only two, or four, warns that there are three answers.

Would be grateful for any help!

After a lot of grief, I solved the problem.

The code should be as follows:

var objCP = document. Captivate;
Var response = objCP.cpEIGetValue ('WidgetAnswer');
Var words;

if(Answer == '') {/ * empty response tests * /}
Words = 0;
Alert("Fred")

}
else {}

Words = Answer.replace(/[^]/g,'').length + 1;    / * counts the number of places in response * /.

}

Where objCP can be any name that you want, and cpEISetValue and cpEIGetValue are special features of Captivate

/ * and * / add a comment

Tags: Adobe Captivate

Similar Questions

  • Is it possible to count the words in a field

    Is it possible to count the words in a field, and that the benefits of this county show upward in another area in LiveCycle? Like regular html Javascript code: If Yes, what is the correct syntax for the two different boxes? Thank you! Daria

    See the attached example.  It uses regular expressions, so a few caveats:

    1. my regex skills stink, so it cannot count words so perfectly that you like.  It is quite tolerant of special characters, but a string like "this & that" is taken into account 3 words, since the & is counted as a Word.  You can change the regular expression to fit your needs.

    2. as this example uses regular expressions in javascript, it will work well in Reader and Acrobat, but I don't think it will work for forms rendered on the server (e.g. exit).  For some reason regex support is missing in the Livecycle server javascript engine. or if it is there it does not work on my server.

    The script is located in the output: the data text box entry event.  You can type in (or paste) text in this text box and when you tab to the box, the number of words will be updated.  You can move the script in a different event on your form according to the when you counted words.

    I would like to know how it works for you.

  • Count the words in the NOTES...

    With this script count the words, but I need to include the words of notes...

    myDoc = app.activeDocument
    T = 0
    for (var j = 0; myDoc.stories.length > j; j ++)
    {
    T = myDoc.stories [j].words.length + T
    }
    Alert ("You have" T + "words in this document")

    Thank you...

    Oh, you use notes, notes

    Then, this will do the job:

    var docWordCount = app.activeDocument.stories.everyItem().words.length;
    var docNoteWordCount = app.activeDocument.stories.everyItem().footnotes.everyItem().words.length;
    
    var myDocWordCount = docWordCount + docNoteWordCount;
    
    alert(myDocWordCount);
    

    Hopefully it will work now.

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • count the lines in a text/csv file.

    Can you advice me how can I get the total number of lines in a text/CSV file please using java code.

    I will get the contents of the text/csv file in a string variable to no not as a file.

    EX: string var = "123\n234\n123\n3456\nsdfsd\n" this is \n in the new line.

    for that I have to get the total rows 5.

    Please advice.

    Thank you.

    I think I have to try a split of the string and see how big the table is either simply to count the number of newline characters. Since you said you have a huge file and your data are contained in 1 chain, then you should be able to do it more conveniently.

  • How can I change the words of predictive text

    Repeatedly, I accidentally saved a word misspelled while text inputing into messages. How can I change/remove these errors? I have a Cliq XT

    Is - that this aid?

  • InDesign doesn't count my words

    I use ID CS3 5.0.4 on a MacBook running OS 10.5.8.

    I go to info to get the number of words in my text, but it does not give me the number of whole word. I can select some text and it will count the words. BUT, if I select all the text in the story, that he will not be cound words. He gives blank results for charaters, lines, words, and paragraphs. Same results in editor mode. He didn't give me any information if I select all. Can anyone help?

    For a long text, it may take a while to count. If this is not it, try trashing the prefs see replace your preferences

  • To count the instances of the text in a group of cells?

    I am converting an Excel document. I used a table in Excel to count the number of times wherever a word of the text appeared in a group of cells. The table does not have in numbers. How do I do this in numbers?

    Hi Bruce,.

    Using the SUBSTITUTE function is a common way to do it. Could you post your Excel formula?

    SG

  • Need help to count the characters in several layers of text

    I use following code to count the number of characters and words in a single text layer. Is it possible to count the number of characters and words in a several layers of text. ?? Help, please

    Java Script code:

    //

    /*

    < javascriptresource >

    < name > Count words and characters < / name >

    < / javascriptresource >

    */

    function run()

    {

    var layer = activeDocument.activeLayer;

    If (layer.kind is LayerKind.TEXT)

    {

    Var words = layer.textItem.contents;

    Words = words.replace (/ (\r\n|\n|\r) "/ gm," "");

    var countwords = words.split("").length;

    var compteLettres is words.split("").join("") .length;.

    Alert ("\n" + countwords + "Words\n" + compteLettres + "Characters", "Count");

    }

    on the other

    {

    Alert ("select a layer of text.', 'Count');

    }

    }

    Run();

    2015, use it at your own risk.

    #target "photoshop - 70.032»

    If (app.documents.length > 0) {}

    var theTexts = main();

    alert (count (theTexts.join ("\n")));

    };

    ////////////////////////////////////

    int main() {}

    the file;

    myDocument var = app.activeDocument;

    get the number of layers;

    Var ref = new ActionReference();

    ref.putEnumerated (charIDToTypeID ("Dcmn"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

    var applicationDesc = executeActionGet (ref);

    var number = applicationDesc.getInteger (stringIDToTypeID ("numberOfLayers"));

    treat the layers;

    var theLayers = new Array;

    for (var m = 0; m<= thenumber;="" m++)="">

    try {}

    Var ref = new ActionReference();

    ref.putIndex (charIDToTypeID ("Lyr"), m);

    var layerDesc = executeActionGet (ref);

    var layerSet is typeIDToStringID (layerDesc.getEnumerationValue (stringIDToTypeID ("layerSection")));.

    isBackground var = layerDesc.getBoolean (stringIDToTypeID ('background'));

    otherwise the layer group.

    If (layerSet! = "layerSectionEnd" & layerSet! = "layerSectionStart" & isBackground! = true) {}

    theName var = layerDesc.getString (stringIDToTypeID ('name'));

    theID var = layerDesc.getInteger (stringIDToTypeID ('layerID'));

    var hasText = layerDesc.hasKey (stringIDToTypeID ("textKey"));

    If the layer type;

    If (hasText == true) {}

    var textDesc = layerDesc.getObjectValue (stringIDToTypeID ('textKey'));

    Letexte var = textDesc.getString (stringIDToTypeID ("textKey"));

    theLayers.push (theText)

    }

    }

    }

    catch (e) {};

    };

    return theLayers

    };

    Count characters.

    function count (theString) {}

    Var words = theString//layer.textItem.contents;

    Words = words.replace (/ (\r\n|\n|\r) "/ gm," "");

    ////////////////////////////////////

    Remove double spaces and space at the end;

    While (words.indexOf("")! = - 1) {words = words.replace ("","")};

    spaces var end = \s$/;

    Words = words.replace (spaces, "");

    ////////////////////////////////////

    var countwords = words.split("").length;

    var compteLettres is words.split("").join("") .length;.

    return ("\n" + countwords + 'Words\n' + compteLettres + 'Characters');

    };

  • Limit the number of words in a text field?

    I have two fields:

    txtStageContent (where the user types in the information)

    WordCountResult (displays the words counted in the txtStageContent)

    in exit the event for txtStageContent, I have the following code to count the number of words (that works):

    var CNT = word_count (this.rawValue);

    WordCountResultTwo.rawValue = cnt.toString ();

    function word_count (textParam)

    {

    textParam = textParam.replace (/ ^ \s * | \s * $/ g, ");

    If (textParam)

    Return textParam.split(/\s+/).length;

    on the other

    return 0;

    }

    My Question is:

    I would like to have a 700 word limit in the txtStageContent text field, is it possible?

    Thank you in advance for your help!

    Hello

    This can be done with a small script in the the change event.

    if (xfa.event.newText.match(/\b\w+?\b/g).length > 700) {
              xfa.event.change = "";
    }
    
  • Re: Satellite U400: can't past the word text in the message from Hotmail - clo

    Hi all

    for some reason, my U400 decided that if I try to paste text from Microsoft Works text information in a file of hotmail, it closed Internet Explorer.

    It is never used to do this, and I was copying and pasting Works Word text in Hotmail messages for years.
    The thing is, I really need to get through this slot i nfo text, because a lot of people cannot open Word works as an attatchment.

    Any ideas please?
    Thank you very much

    Have you tried another browser like Firefox?

    I noticed that MS has updated the IE7 to IE8.
    For several days I m using the new IE8, but I cannot test it with hotmail
    But I have already inserted the word text in my mail and the IE8 worked well

  • Is it possible to incorporate a note in a formula? In other words, to insert text which would be ignored by the formula processor?

    Is it possible to incorporate a note (a comment text) in a formula? In other words, to insert text which would be ignored by the formula processor?

    None

    You can attach comments to a cell:

  • Lately when I use the mouse the words text scrolling and copy on top of itself a million times. This happens when I am on line reading something to say on the MSN homepage.

    Lately when I use the mouse the words text scrolling and copy on top of itself a million times. This happens when I am on line reading something to say on the MSN homepage. Sometimes I can click off on the side and separates the text and I can read it but when I use the scroll of the mouse or even the scroll bar on the sideit happens again and again.

    Hi Jaynebasye,

    1. This only happens when you are on the MSN Web site?

    2. did you of recent changes on the system?

    Method 1:

    You can try to change the scroll settings and check.

    For more information, see the following article

    Change the settings of the mouse

    Method 2:

    Step 1:

    You can also check if the problem occurs in safe mode with network.

    Startup options (including safe mode)

    Start your computer in safe mode

    Step 2:

    If you do not experience the problem in safe mode with network, then perform a clean boot.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    Note: Make sure that you put the computer to a Normal startup once you are finished.

    Hope this information is useful.

  • Scrolling text widget displays at the top of the text of comments

    Untitled.png

    In HTML5, the scrolling text widget is the display on top of text in comments. Background: I have converted the legends of success and failure by default in smart objects I can use an overlay image for correct/bad comments. When your comments appears, it is an image full screen. The scrolling text widget is reflected and is actually on top of the image of your comments. This happens even when the widget is at the bottom of the timeline. Any ideas on how we can have the overlapping of feedback (dynamic object) appear at the highest level (top)?

    Hi Amy,

    You can try the following:

    1. close Captivate and save your project

    2. go in the Captivate installation directory [in general is: C:\Program Files\Adobe\Adobe Captivate 9 x 64]

    3. copy the file "AdobeCaptivate.ini" to your desktop

    4. open this file in the editor and change the value of 'UseWidget7' to 1.

    5. save a copy of this return to its original location

    6 restart Captivate and open your project

    Can you try this and see if it helps?

    Thank you

    MohanA

  • How to reverse the text so that the words are composed of video clips

    Hi all.

    So I want to use a piece of video (image below) to compose the Word Central more daring for a promotional clip. The video layer will be chalk floating in the air and I want my text. So I guess I should do some kind of reverse with the text to display the video layer below.

    Can someone point me in the right direction for how to do this in PP please?

    Boulder.00_02_30_06.Still002.jpg

    Put your video on track 1

    put your text in white (made in the Titler) in track 2.

    Add the track matte effect for clip in track 1 and set the matte to track 2,

    fact.

  • How to reference the first word in a text frame (threaded)?

    Hello.

    I have a series of threaded text images.
    I want to be able to reference the first word of each of them.
    [This is no big deal to start the project and do it all on the fly].

    Any ideas how I can get there?

    Any help would be appreciated.

    To get the content of the Word use myWord. content to move the Word use myWord. move (LocationOptions.AT_BEGINNING, myDestinationTextFrame);

Maybe you are looking for

  • Problem opening in new tab...

    Hello. When I open a new TAB, with a lag, the new address of the page (http://isearch.babylon.com/?affID=120024 & babsrc = NT_ss & mntrId = b06b4c1b00000000000000158315a310), and then it goes to the address (http://mystart.incredibar.com/MB131?a=6PQG

  • I can activate Siri when my iPhone is locked.  Why can't I do the same thing with my iPad?

    Why can't I activate Siri with my iPad locked as I can with my locked iPhone?

  • Office 2008 compatibility

    I have a 2009 Mac with snow leopard 10.6.8 and the release of Office for Mac 2008 12.3.6 version I bought at the same time is already up and running.  If I'm going to El Capitan Office 2008 (already installed) will still work?  The Excel is vital for

  • Card PCI NI4461 CAD output anomaly

    Hello I use NI4461 PCI Card for a frequency response Analyzer application. Red I have a specific profile waveform to be generated using a DAC card. I tried to use the NI4461 card for this. But for DC output function calls, I get a glitch until the wa

  • Files TEM Internet & low disk space

    checked the show hidden files and my temporary directory shows 25 GB and 20 files.  But I don't see it.  I'm out of space b/c of this