[JS] Help Locating TextCount.js

Hi Guys,
I am trying locate TextCount.js
It google says It should be in the Goodies folder of the instal cd.
I've looked in my CS Package without luck, also CS2 and CS3
Would anyone know where it is?
Or be able to port the code here for me please.
Or know of a text character counter which does side notes and overset text and unlinked stories???
Thanks
Marcus

For a simple one check here:
http://mysite.verizon.net/zevt/index_files/WordCount.htm
And this is what I found on a search on my computer...
//TextCounter
//An InDesign 3 JavaScript
//Counts text objects in the selection, in the selected story, or in all
stories in a document.
//For more on InDesign scripting, go to
http://www.adobe.com/products/indesign/scripting.html
//or visit the InDesign Scripting User to User forum at
http://www.adobeforums.com
if(app.documents.length != 0){
if(app.activeDocument.stories.length > 0){
myDisplayDialog();
else{
alert("The current document does not contain any text.");
else{
alert("No documents are open. Please open a document and try again.");
function myDisplayDialog(){
var myCountButtons, myRangeButtons;
var myDialog = app.dialogs.add({name:"TextCounter"});
with(myDialog.dialogColumns.add()){
with(borderPanels.add()){
staticTexts.add({staticLabel:"Count:"});
with(myCountButtons = radiobuttonGroups.add()){
radiobuttonControls.add({staticLabel:"Characters"});
radiobuttonControls.add({staticLabel:"Words",
checkedState:true});
radiobuttonControls.add({staticLabel:"Lines"});
radiobuttonControls.add({staticLabel:"Paragraphs"});
with(borderPanels.add()){
staticTexts.add({staticLabel:"Range:"});
with(myRangeButtons = radiobuttonGroups.add()){
radiobuttonControls.add({staticLabel:"Selection",
checkedState:true});
radiobuttonControls.add({staticLabel:"Selected Story"});
radiobuttonControls.add({staticLabel:"All Stories"});
var myReturn = myDialog.show();
if (myReturn == true){
//Get the values from the dialog box.
var myRangeType = myRangeButtons.selectedButton;
var myCountType = myCountButtons.selectedButton;
myDialog.destroy();
myTextCounter(myRangeType, myCountType);
else{
myDialog.destroy();
function myTextCounter(myRangeType, myCountType){
var myDocument, myTextCount, mySelection, myCountingUnit;
with (myDocument = app.activeDocument){
//Set the AlreadyCounted key of any stories in the document to
false.
for (var myStoryCounter = 0; myStoryCounter <
myDocument.stories.length; myStoryCounter ++){
myDocument.stories.item(myStoryCounter).insertLabel("AlreadyCounted",
"False")
switch (myRangeType){
case 0:
//Count the text in the selection.
//If multiple text frames are selected, all of the
//text in the frames will be counted.
mySelection = selection;
if (mySelection.length == 1){
myTextCount = mySelectionSorter(mySelection[0],
myRangeType, myCountType);
else{
myTextCount = 0;
for (var myCounter = 0; myCounter <
mySelection.length; myCounter++){
myTextCount = myTextCount +
mySelectionSorter(mySelection[myCounter], myRangeType, myCountType);
break;
case 1:
//Count the text in the parent story (or stories) of the
selection)
mySelection = selection;
if (mySelection.length == 1){
myTextCount = mySelectionSorter(mySelection[0],
myRangeType, myCountType);
else{
myTextCount = 0;
//Now iterate through the items and count the text.
for (var myCounter = 0; myCounter <
mySelection.length; myCounter++){
myTextCount = myTextCount +
mySelectionSorter(mySelection[myCounter], myRangeType, myCountType);
break;
case 2:
//Count the text in all stories of the active document.
myTextCount = 0;
for(var myStoryCounter = 0; myStoryCounter <
myDocument.stories.length; myStoryCounter ++){
myTextCount = myTextCount +
myCountText(myDocument.stories.item(myStoryCounter), myCountType);
break;
switch(myCountType){
case 0:
if (myTextCount == 1){
myCountingUnit = "character";
else {
myCountingUnit = "characters";
break;
case 1:
if (myTextCount == 1){
myCountingUnit = "word";
else {
myCountingUnit = "words";
break;
case 2:
if (myTextCount == 1){
myCountingUnit = "line";
else {
myCountingUnit = "lines";
break;
case 3:
if (myTextCount == 1){
myCountingUnit = "paragraph";
else {
myCountingUnit = "paragraphs";
break;
var myDialog = app.dialogs.add({name:"TextCounter",
canCancel:false});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){
with(borderPanels.add()){
staticTexts.add({staticLabel:"InDesign found "});
with(dialogColumns.add()){
textEditboxes.add({editContents:myTextCount+""});
with(dialogColumns.add()){
staticTexts.add({staticLabel:myCountingUnit});
myDialog.show();
myDialog.destroy();
function mySelectionSorter(myObject, myRangeType, myCountType){
var myTextCount;
switch (myObject.constructor.name){
case "Text":
case "InsertionPoint":
switch (myRangeType){
case 0:
myTextCount = myCountText(myObject, myCountType);
break;
case 1:
myTextCount = myCountText(myObject.parentStory,
myCountType);
break;
break;
case "TextFrame":
switch (myRangeType){
case 0:
myTextCount = myCountText(myObject.texts.item(0),
myCountType);
break;
case 1:
//Has the parent story already been counted?
myStory = myObject.parentStory;
myCountedState = myStory.extractLabel("AlreadyCounted");
if (myCountedState != "True"){
myTextCount = myCountText(myStory, myCountType);
myStory.insertLabel("AlreadyCounted", "True");
else {
myTextCount = 0;
break;
break;
default:
//Selection is a not a text object.
//There's still a chance it could be a textPath object.
if (myObject.textPaths.length !=0){
myTextCount = 0;
if (myRangeType == 1){
for (myTextPathCounter = 0; myTextPathCounter <
myObject.textPaths.length; myTextPathCounter ++){
myStory =
myObject.textPaths.item(myTextPathCounter).parentStory;
myCountedState =
myStory.extractLabel("AlreadyCounted");
if (myCountedState != "True"){
myTextCount = myTextCount +
myCountText(myObject.textPaths.item(myTextPathCounter).parentStory,
myCountType);
myObject.textPaths.item(myTextPathCounter).parentStory.insertLabel("AlreadyCounted","True" );
else{
myTextCount = 0;
else {
for (myTextPathCounter = 0; myTextPathCounter <
myObject.textPaths.length; myTextPathCounter ++){
myTextCount = myTextCount +
myCountText(myObject.textPaths.item(myTextPathCounter).texts.item(0),
myCountType);
else {
myTextCount = 0;
break;
return myTextCount;
function myCountText(myTextObject, myCountType){
var myTextCount;
switch(myCountType){
case 0:
//count characters
myTextCount = myTextObject.characters.length;
break;
case 1:
//count words
myTextCount = myTextObject.words.length;
break;
case 2:
//count lines
myTextCount = myTextObject.lines.length;
break;
case 3:
//count paragraphs
myTextCount = myTextObject.paragraphs.length;
break;
return myTextCount;

Similar Messages

  • HT1338 Need help locating where and how to update Mac OS-X 10.6.5 to the latest Mountain Lion Software...thanx John

    I need help locating where and how to update Mac OS-X to Mountain Lion.....Thanx....Jay

    First update your 10.6 version to 10.6.8 from the software update under the Apple Menu.
    This will add direct access to the Mac App store via a new application.
    Now launch the App Store from your Applications folder - Its the new icon a letter A formed from a ruler pencil and pen on a blue circle !
    Once launched you need to add your iTunes account details or create an account add payment details etc...
    Sign in purchase download and follow install processes to upgrade to 10.8 Mountain Lion.
    OH and to be safe BEFORE you install backup your current system to an external drive !

  • Need help locating my stolen iPhone

    Apart from the "findmyiphone" application, are there other measures I can take to help locate my stolen iPhone?

    Hello alueshima,
    I'm sorry to hear about your phone. I think you should look over the information in this article from Apple:
    If your iPhone, iPad, or iPod touch is lost or stolen
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • PLEASE HELP LOCATE SONGS FROM EXTERNAL HD (Cloud)

    First off, I would like to thank ANYONE who can help me out please! I am desperate now for some advice to help me through this, I have spent the last 10 Hours (Not Exaggerating) trying to find a solution to my problem online and reading through countless things I HAVE NOT been able to get an answer to resolve the issue that I am having. Please I beg you to help me! I just wanna call Apple Support so that someone can walk me through this but I am using a Windows and they won't take calls from Windows users (which is kind of lame since I am an Iphone/Ipad/Itunes customer just not on an Apple Computer) and honestly I would even pay money to have this issue fixed already I just don't wanna waste any more time on it!!!
    SO, that being said. Here is the most concise explanation I can give you of my troubles!
    1. I have both a Laptop and a Desktop. My Laptop has been my primary source for Itunes for the passed 8 years, however, it is old and I want to start using my Desktop for Itunes from now on..also, I NEED to free up space on my Laptop so that I can back up my Iphone 5 which has a broken screen, but that's another story!
    2. I Purchased something called a "WD MY CLOUD" Which is basically a personal ICloud that has 2TB of external HD Space on it. I hooked up my WDMyCloud and configured it, got it working perfectly, and I began the multiple hour long process to transfer my ITUNES Folder from my Laptop over to the WDMyCloud.
    3. All of the files and songs were successfully transferred from my Laptop to the WDMyCloud.
    4. I Installed Itunes onto my Desktop.
    5. I shift+clicked Itunes and chose the Itunes Library from my WDMyCloud. I believe the file is found in: \\WDMYCLOUD\Oliver\iTunes\iTunes Library. (And that is the .itl)
    6. When I have Itunes open, I go to preferences, and I change the MEDIA Folder to the iTunes Music Folder located on my WDMyCloud. I believe the file is found as: \\WDMYCLOUD\Oliver\Itunes\iTunes Music. (It does have all of my songs in there on the WDMyCloud in Folders by Album or however itunes had it organized)
    7. Now I am staring at my Itunes Playlists and All of my Songs are there, however, whenever I try to Play ANY Song on there I receive this error: "The song "xx" could not be used because the original file could not be found. Would you like to Locate it?" (And no, I would not like to manually locate over 3,000 songs)
    Also, every single Song has an "!" Exclamation mark next to it.
    8. If I use "Get Info" about the track to see where Itunes is looking for the track, I will show you an example now here to what it says:
    "file://localhost/C:/Users/Oliver/Downloads/Firebeatz - Gangster (Original Mix).mp3"
    (Now I do realize that this is incorrect, it should be looking for the songs in my WDMyCloud, that path above is from my Laptop's Downloads Folder and I have no idea how to fix this.)
    9. I have also tried using the "FindTracks.vbs" on my \\WDMYCLOUD\Oliver\Itunes\iTunes Music Folder and this did nothing, at all.
    10. I have opened the Itunes Library XML that is saved onto my WDMyCloud from my Laptop, and it shows the script as:
    <plist version="1.0"><dict><key>Major Version</key><integer>1</integer><key>Minor Version</key><integer>1</integer><key>Date</key><date>2014-05-24T16:40:35Z</date><key>Application Version</key><string>11.2</string><key>Features</key><integer>5</integer><key>Show Content Ratings</key><true/><key>Music Folder</key><string>file://localhost//WDMYCLOUD/Oliver/Itunes/iTunes%20Music</string><key>Library Persistent ID</key><string>5C3728163E81BB1D</string><key>Tracks</key>
    <p
    ^^ Now I'm not really sure how clumped up that is going to look once I post cuz when I tried copy/pasting it from the XML on to here it came out looking super weird, but as you can see the key thing there is that the file it says it's looking in is the Itunes Music file in my WDMyCloud. So I don't know what could be wrong with the XML script path if there is anything wrong with it at all. The rest of the XML is super super long list of all my tracks and albums an such which is obviously unimportant to this matter. But maybe this can help figure out my problem.
    Anyway, that's about as far as I was able to get after 10 hours of research, and like I said, still no solution. I'm stuck! Please please please help me figure this out! One of the biggest reasons I purchased this WDMyCloud was to use it as a consistent Itunes mediator between my devices and I absolutely MUST free up space on my Laptop ASAP and this is the only way! Thank you so much for your help in advance!!

    See Make a split library portable for some general advice on making a working library portable. It should be less hassle than fixing a broken one.
    Since the library works perfectly on the laptop I would suggest you start over and do it like this;
    1. Create a new iTunes folder in the root of the external as \\WDMYCLOUD\iTunes (capitalised as shown please, just to appease my OCD)
    2. Copy into it the following items from C:\Users\Oliver\Music\iTunes
    Album Artwork
    iTunes Library.itl
    iTunes Library Extras.itdb
    iTunes Library Genius.itdb
    sentinel
    3. Shift-start iTunes and open the library at \\WDMYCLOUD\iTunes\iTunes Library.itl
    4. Under Edit > Preferences > Advanced change the media folder to \\WDMYCLOUD\iTunes\iTunes Media (again capitalised as shown please)
    5. Use File > Library > Organize Library. Tick both boxes, or the one that isn't greyed out, then click OK.
    iTunes will gather in copies of all your media files, putting them into the correct locations so that the library is in the modern layout, and able to be moved from one machine to another.
    I'd recommend you clone the entire iTunes folder to another drive (see this backup tip) before you think about cleaning the originals.
    If your library is large then having the library files on a network share will slow things down as the database has to be written out almost any time you do anything with your library. Once you've connected the library to the new computer and had it opened and working you can copy the library files and Album Artwork folder into the local C:\Users\Oliver\Music\iTunes folder (deleteing what is already there first) then shift-start-iTunes and connect to C:\Users\Oliver\Music\iTunes\iTunes Library.itl. If/when you want to move the library to a different drive/computer copy the files back out to the drive and access the library there at lease once before the move.
    tt2

  • Help locating rendered files for relinking after a crash.

    I am working on an adobe premier pro project and my computer crashed yesterday. the project file no longer opens as it is asking where certain rendered files are located...  I do not know where premier is hiding them so when I hit skip or try to offline them the project tries to open and it freezes up. I was able to open an auto save file but now the project runs very very slowly... every click or action takes the computer about 2 minutes to respond and if I click while it is thinking... it crashes.
    HPZ400 workstation
    win 7
    CS5

    Maybe a shot in the dark, but did you at anytime change your project scratch disk settings at any time. If not maybe have a look at the Default folder for scratch disk settings. Can't remember exactly where it is but it will be on your boot drive under user/ your name or failing that try relocating it by copying  the file asked for when PP loads and do a search on your entire machine. This may reveal something usefull like a location where stuff has been saved.
    Hope that helps.
    Dave.

  • Help locating files after migrate assist.

    I have just successfully moved files from my PC to my new MacBook Air.  I couldn't find the files at first, but then read some other message boards and realized they were copied to a different user.  So I logged into that user account.  Still can't find my files.  I got to Finder and there is nothing... no music, no photos, no documents.  iTunes has updated... all my files and playlists are there, but I can't find anything else. 
    Another message board said I could type the file name into the Spotlight... I did this and there everything is!  But how do I access it without typing in a file name?  I am not going to remember the name of every single file.  I just want to go to a folder somewhere and find my files.  HELP!!!  I love my new Mac, but this is soooo frustrating!
    Any help would be appreciated.  Thank you in advance!
    And once I find these files, if you would like to tell me how to transfer them all to my Admin user account, I will love you forever. 
    P.S.  I have even tried turning on the Shared folder, but it doesn't show up in Finder.  Ugh!

    Open a Finder window and select
    View ▹ Show Path Bar
    from the menu bar, if it's not already selected. Select All My Files in the sidebar and locate one of the files. The path to the file will appear in the path bar at the bottom of the window. Click the enclosing folder to open it.

  • Please help locate imported contacts

    new iMac: OS X 10.8.2
    I am trying to help someone locate their contacts- which were imported (not by me) from a NON Apple computer
    when they click on "Address Book" now, it is empty
    I tried Applications / Contacts and same result
    please advise-- thank you

    These may help:
    Importing contacts into Address Book
    http://support.apple.com/kb/PH4672
    http://support.apple.com/kb/PH4648
    http://support.apple.com/kb/PH4655

  • GRC 5.3 help location

    How do I change the help link (located in header of web pages) that now points to http://help.sap.com to point to a local file system?  I have loaded the plain HTML help on a local directory and need to use that location since the internet is not accessable from GRC for the users?

    Jack,
      You can not change this link without changing the underlying jsp/java code. This is not a standard functionality so if you make this change it will be overwritten with any SP change.
    Alpesh

  • HT5594 HELP: location services

    Why can't I turn on my location services on my iPhone 5c with iOS 7?..
    It's a blurry page when I go into Settings > privacy > location services.
    It won't allow me to turn off anything. Someone help !

    Check in Restrictions...
    Settings > General > Restrictions
    Understanding Restrictions  >  http://support.apple.com/kb/HT4213

  • Help Locating my serial number for Final Cut Studio?

    Can anyone help me in Locating a serial number for my Final Cut Studio??-- I dont know where the booklet "installing your software" is --i have all other disks and books-- i need to upgrade from FCP5.1 to 6.2

    The booklet is the only place where you can find the serial #.
    There is a file on your computer, but it is encrypted.
    You might be able to get the number from the splash screen (Final Cut Pro > About Final Cut Pro) but I have heard that it is not displayed in full in some releases. It certainly displays in full on the FCP 7 splash screen.
    Should none of the above help, follow the instructions here: http://support.apple.com/kb/HT1861

  • HT4061 need help locating my iPad

    I have a windows phone and can't download iTunes or icloud to find my iPad, it is the night before thanksgiving and the call center is closed can anyone help PLEASE

    If the iPad was running iOS 7, the thief will not ever be able to use it.
    iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    Apple (and no one else) can not assist (with serial number or iCloud) in finding a lost or stolen iPad.
    Report to police along with serial number. Change all your passwords.
    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    What to do if your iOS device is lost or stolen
    http://support.apple.com/kb/HT5668
    iCloud: Locate your device on a map
    http://support.apple.com/kb/PH2698
    iCloud: Lost Mode - Lock and Trace
    http://support.apple.com/kb/PH2700
    iCloud: Remotely Erase your device
    http://support.apple.com/kb/PH2701
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    How to recover a lost or stolen iPad
    http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    What NOT to do if your iPhone or iPad is lost or stolen
    http://www.tomahaiku.com/what-not-to-do-if-your-iphone-or-ipad-lost-or-stolen/
    Apple Product Lost or Stolen
    http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st olen
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
    If you don't know your lost/stolen iPad's serial number, use the instructions below. The S/N is also on the iPad's box.
    How to Find Your iPad Serial Number
    http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
    iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
    http://support.apple.com/kb/HT4061
     Cheers, Tom

  • TS2446 Need help locating stolen phone

    My iphone 4S was stolen today.  I've only had a couple of months and had not downloaded any type of tracking app.  Is there by chance something automatically installed on the phone that could help me locate it?  Thank you.

    If you didn't go to Settings>icloud and turn on Find My iPhone, then you are out of luck.  If the device did have this service turned on, then using a computer's browser, log into your icloud account at icloud.com and go to the Find My iPHone page to try to track it.

  • I got robbed in Aruba and they stole my daughters iphone.  Need help locating it.  I went on line and icloud states device is off line.

    I went to Aruba on vacation and they stole all my stuff including my daughters iphone.  I went to icloud but it states all devices are off line.  Can you please help.

    iCloud (http://icloud.com on a computer or Find My iPhone on another device) are the only way that you might be able to try and locate it. What iOS version was on it ? If it was on iOS 7 then they won't be able to reset it without your password.
    I assume that you've reported it to the police (?). You should also contact your carrier and change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.

  • Help locate HP Deskjet 5900 series driver download (Windows 7)

    Hello, when I plugged in my old printer to my laptop which has Windows 7 on it. It says that the driver wasn't found. I tried finding the driver download on here, but could only find one that was compatable with old versions of Windows can someone help me locate a windows 7 compatable version?
    HP Desktjet 5900 series

    Hello jordanyHD, Welcome to the Forums!
    I just came across your post and noticed you are looking for drivers for your Deskjet 5900 series printer.
    As I am unsure of which exact printer you have, I am not able to see if the driver is available for Windows 7. If you wish to respond with your model number, I will gladly check for you!
    Please click this link and type in your printers exact Model Number to see if there are available drivers for your specific printer model.
    HP Drivers & Downloads
    Take care,
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • Help Locating music files after transferring  using Windows Migrartion Assistant

    I am new to mac I just bought a new MacBook Pro Friday. I have an iPod, iPhone, and an, iPad that I need to get setup on my Mac. The way I have them setup on my Windows 7 PC is I can select wich iTunes library to open by pressing the shift key while clicking on the iTunes icon. My first question is can I set that up like that on the Mac as well? Also I used Windows Migrartion Assistant to transfer my music files from my windows 7 PC to my Mac after the transfer was finished I cannot locate the music files on the Mac anywhre. Can anyone help.

    Apparently the old external drive is going bad. I turned it off and waited an hour or so and restarted it, and all my files were back. I have copied them to my PC hard drive to be safe. However, my iTunes is now totally screwed up. Although the music files are back where they were (for now), iTunes cannot find any songs except the few that were copied to the new drive when I did the consolidate. I tried the Consolidate Library again and it stops because it cannot find the files. Am I going to have to point iTunes to the location of every song, one at a time, for over 2800 songs?

Maybe you are looking for

  • What is the keyboard shortcut to restart my mac and launch windows?

    what is the keyboard short cut to launch windows from my macbook?

  • Labor time report at each individual level

    I want to take report on each individual employee labor hours based on the time confirmation they did thru IW41, Is there any standard report available???? we dont have activity types as we are not settling cost for the inhouse labor but doing time c

  • Database  applet error in web browser

    hi to all i have query in applet. MY APPLET IS USING ODBC AND CONNECTING TO ACCES. I HAVE CREATED POLICY FILE SO THAT I CAN DISPLAY APPLET IN APPLETVIEWER. APPLET RUNS FINE IS APPLETVIEWER WITH FOLLOWING COMMANDLINE Appletviewer -jDJava.security.poli

  • I need big help

    I just installed the Java2 standard edition and I am just stuck on what to do period. I have a book called Java2 and I am stuck right at the part with "Class" I don't know how to make the javac run to make a class. The only thing I've done so far is

  • Windows Server 2012 R2 Will Support for UEFI boot in WDS.

    Hi Currently we had issue in WDS while deploying the image via UEFI boot in the DELL Optiplex 3010. We already deployed the Windows 8 install image and boot image in the Windows Server 2012 R2. After selecting the Network boot its show Start PXE IPV4