Applescript Interactions with Footnotes in Word

hi,
I have run across a basic issue that has really frustrated me, I think it is a bug, but I would like someone else to take a look at it. From my testing it seems that using applescript, the following commands "Move Start of Range", "Collapse Range", "Move Range While", "Move Range Until", and several other "Range adjusting commands" do not work if your text range is in a footnote. Has anybody run across an issue such as this before? If so did you find a solution? If this is in fact a bug, where would be the proper place to report it?
I would appreciate any help in this matter you may have.
I have added a small snippet of code that will illustrate this.
tell application "Microsoft Word"
collapse range text object of selection direction collapse end
set myFootnote to make new footnote at active document with properties {text range:text object of selection}
set content of text object of myFootnote to "This is some test filler for the footnote"
set myRange to text object of myFootnote
select myRange
--by commenting out the line below, you will see that everything up until this point works correctly
move start of range myRange by a word item count 1
--I might be looking at it wrong, but this gives the wrong results (you will see many more issues with the other commands listed as well
end tell
If I am looking at this right, is this a bug in the applescript?
Regards.
Brian

Hi queenbeebrooklyn
try this
set FindWordsToReplace to "This word" as text
tell application "Microsoft Word"
set GetTxt to find object of selection
tell GetTxt
clear formatting
set its content to FindWordsToReplace
tell its replacement
clear formatting
set its content to FindWordsToReplace
tell its font object
set bold to true
end tell
end tell
execute find wrap find find continue replace replace all with match forward and match whole word without match case
end tell
end tell
Budgie
Message was edited by: Budgie

Similar Messages

  • Applescript Interacting with a PList

    I'de like to create a PList file when someone runs my application, and then change the variables in the file based on what buttons you choose. It would have to also work for various users as I'm distributing the app. Something like:
    Display Dialog "Keep a log?" buttons {"No", "Yes"} default button 2 with title "Config"
    if button returned of result is "Yes" then
    -- Some command to change the variable to "Yes" in a PList file to remember for next use
    else
    -- Some command to change the variable to "No" in a PList file to remember for next use
    end if
    Is this possible? If so how? Thanks in advance. Really hoping you see this post, Red_Menace...

    There are a few ways to use preferences in your application.  If you are writing a Cocoa-AppleScript (regular or Xcode), you can use NSUserDefaults.  For a regular AppleScript application, a property is persistent and is saved with the script (at least until the script is recompiled), and there is also the defaults command.

  • Interacting with MS Word through Java

    Hi friends,
    How to interact with a MS Word file through the java program. please send me some sample codes. Thanks in advance.....
    Regards,
    Prakash.....

    Prakashjava wrote:
    Hi friends,
    How to interact with a MS Word file through the java program. please send me some sample codes. Thanks in advance.....
    Can't be done in pure Java.

  • Importing MS word files with footnotes

    Laying out a textbook. Client provided formatted text. The footnotes travel with the text as I edit which is great. However, I do not want the rule that separates the footnote from the text. I've searche ID and MS Word high and low to see how to get the rule to not appear. Any ideas or can it not be done without having to placing the files without formatting and starting from the ground up in ID? See link for screen shot. Thanks.
    http://www.pelhamprint.com/uploads/footnotes.jpg

    Hi there, I'm working with InDesign CS (I bought it a few years ago now, so its not the most current). I am trying to import a word doc with footnotes, but they will only import as endnotes, even though I have selected the import option for 'footnotes and endnotes'. I am doing a 50,000 work book, so I'd like each footnote to be at the bottom of each relevant page for easier reading. It should be very simple but I have no idea how to get around this. As usual, I have an impending deadline, so any advice or feedback or ideas would be greatly appreciated.
    BTW Clearly I am not a computer guru, so 'scripting' etc would be way too complicated for me.
    Cheers :-)

  • I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.

    I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.
    Both these situations have cropped up on my MacBook Pro since the last update.
    Thanks for your help.
    Cheers
    Bob

    The 'Winmail.dat' problem has been extensively covered in these forums, I would search for that (a Google search works well) and unfortunately I have not seen the pdf print problem before, but assuming the software is current and functions normally (other than the pdf print problem) I have no suggestion other than the obvious (but time consuming) re-installation of Office.
    I wish I had more

  • Cannot Interact with Microsoft Word 2008 for Mac after Opening

    After I open Microsoft Word 2008 for Mac, either by opening a .docx file or opening Word from the Applications folder, I am not able to interact with the application whatsoever.  Selecting its icon in the dock does not bring any of its windows to the front, nor does it show the Word menu at the top; instead, it still shows the menu of whatever application was previously selected.  But the windows do exist if I move other windows out of the way.  If I do get to a Word window, I cannot click on anything, select anything, resize it, close it, or scroll.
    Other info: If I click and hold the Word icon in the doc, the menu displays as if the application were functioning normally; it does not show a Force Quit option, as it would if Word were frozen.  I do not see any dialogue boxes or anything that would take the focus away from the other windows.
    Background: I was able to successfully use Word without any problems before today, using the same installation of the application, same computer, and same operating system. I also never had this problem before Mavericks, though, as I said before, I didn't always have this problem in Mavericks.
    How do I get Word to function normally again?  Thanks for any help you can provide!

    After letting Word run for quite a while, a popup window told me there was an issue with the database.  I opened the Microsoft Database Utility and rebuilt the database.  It seems to be working fine now.

  • Working with Pages and Word-questions!

    NOTE: Sorry for the similarity of this to my post a few minutes ago titled "Which do I use, Pages or Word)? I learned some things through experimentation and have created subtler and more challenging questions for you.
    Help me out here (please). I am now working with Pages, sharing documents with dozens of behind the times colleagues who are using some old program called "Word." It's my job to work with these people and I'm trying to make it as easy for everyone as possible.
    Do I have this right? When I create a document (or open an old Word document into pages), in order to be able to share it with people, I save it, and check the box to save a copy in Word format. Then when I send my documents, it works like a charm. Yes?
    If I start by opening a Word document, and every time I save I check "save copy to Word," I end up with only one document, no version in Pages. If I start with a Pages document, or save without checking the box, I end up with two separate versions of the document (like when I create a pdf)? It appears that if I I want to keep working in the Word format, every time I save it will give me a dialog box and make me check the box (and possibly select my location). This is cumbersome since I am now in the habit of saving often (you learn that when you work with Word for the Mac for any period of time--bomb, bomb, bomb). So, an I correct in assuming that if I want to save regularly, I really have to work in Pages, and then be scrupulous about saving into Word when I'm done for the day, or just before I send? It's sort of a pain in the butt, although I can learn to do it--I just want to make sure I'm not missing something here. Also, is there an autosave function so I don't have to rely on my discipline? Or does it never ever bomb?
    What happens if I open the Word version and make changes to it? Do I have to do something differently to make sure I have both versions identical? Am I better off always to open the Pages document to work on, then save and send?
    Do I always then have two versions of the same document (like I would if I did this same thing with pdf)?
    How do I make sure that the Word version is always up to date since that is the one I am sending to colleagues? Do I always have to save and check the box, and then select the correct document to send?
    I do see that when sending a single document I can easily send it while I am in the document itself. When I do this, selecting to send it as a Word document (or a pdf for that matter), will it send the version I most recently saved, or the version that is on my screen (if I forgot to save changes)?
    FInally, I'd be open to any tips from people working regularly with others who must use Word. I want it to work as simply as possible, but want to set up some good habits from the beginning.
    Finally, finally, have you had problems with compatibility. I have to say that there have been very few Word document yet that I've opened that I haven't gotten a message that says that Pages doesn't support some aspect of the document and formatting is removed, or spacing is different, etc. The most common is that "paragraph borders operate differently so all borders except outside borders have been removed." I'm a bit nervous about this--will I be getting documents from others that I can't trust? Will I have to ask them to send a pdf as well so I can confirm that I got it right? Can anyone ease my mind? Or am I living in reality?
    Thanks a million!
    EagerLearner
    Message was edited by: eagerlearner

    Well yes they are not the same program so there will be differences.
    For example Pages only allows a border all the way around a paragraph with few options on the style of line, which is why you got the warning.
    A workflow would consist of you doing your work in Pages however you like it and when you have finished and saved, making a Word copy which you despatch to your colleagues and then throw away.
    Of course this is more cumbersome than sticking with MsWord which is another option. You choose. It comes down to whether or not you have to tightly conform and interact with Word users. Maybe Pages is not for you, or even NeoOfffice which is a clone of MsOffice.
    Test it. If it works and you like it stick with whatever solution works for you.

  • Interacting with MS-Office

    1) From ASP.NET, I can interact with the MS Office applications and generate and poblate new Word, Excel, Power Point documents programatically. Can I do the same with JSP?
    2) From ASP.NET I can use Visual Basic COM+ componentes (three-tier model). I have heared about CORBA tech, which is the same for Java. How does this function?

    Not specific to the MS Office stuff, but others have answered that, but since you're a newcomer to the Mac, see these:
    Switching from Windows to Mac OS X,
    Basic Tutorials on using a Mac,
    Mac OS X keyboard shortcuts,
    Anatomy of a Mac,
    MacTips,
    Switching to Mac Superguide, and
    Switching to the Mac: The Missing Manual, Mountain Lion Edition.
    Additionally, *Texas Mac Man* recommends:
    Quick Assist,
    Welcome to the Switch To A Mac Guides,
    Take Control E-books, and
    A guide for switching to a Mac.

  • Interact with third-party applications

    Do anybody have a try to Interact with third-party applications when using CQ5?
    I have some questions when I do that, when I use ajax to get data from my custom application,it always return error message,below is my ajax code:
    function getMinisiteList(){
              var sendUrl="http://localhost:8088/innosite/minisite/home.json";
              $.ajax({
                        url : sendUrl,
                        type : "post",
                        dataType : "json",
                        success : function(data) {
              alert(data);
                        error : function(XMLHttpRequest,
                                            textStatus, errorThrown) {
                                       alert(XMLHttpRequest.status);
            alert(XMLHttpRequest.readyState);
            alert(textStatus);
    I think my ajax request is Intercepted by CQ,is it right? How can I do that? Can anybody answer me?
    thank you very much!

    Is this a cross-site request? In other words, is JavaScript above being executed on localhost:8080? If not, you are likely running into a cross-domain browser security restriction.

  • Can Director Interact With Other Applications?

    Hello,
    I am a CBT/E-Learning Developer looking for a way to author
    Guided Help. I am thinking of how to develop interactive tutorials
    that, instead of using screenshots of an application, interact with
    the application itself.
    For instance, let's imagine that a person is working in MS
    Word and doesn't know how to save a file. He can click the icon for
    the "Saving A File" lesson, and a caption displays on top of MS
    Word that reads something like "Click FILE", along with some type
    of indicator of the FILE button, such as an outline, highlight,
    arrow, etc. The user clicks FILE, the File Menu drops down in MS
    Word, and the next step of instructions is displayed. In this way,
    the usre is guided through the steps of saving a file as he
    actually performs the task in the software.
    Can Director create this type of thing?
    Thanks a lot,
    Mike

    Hi Chunick,
    Thanks for replying. I used MS Word as just an example; the
    type of software I'm wanting to use this for is police records
    management software. I've been doing the interactive simulation
    tutorials for them since 1999, using multimedia authoring tools
    Demoshield and Opus Pro, and demo authoring tools RoboDemo and Demo
    Builder. However, I wanted to get away from interactive tutorials
    for 3 reasons:
    (1) My client's software is frequently updated, and keeping
    up with taking new screenshots is a hassle.
    (2) I'm of the opinion that "at the moment of need", process
    embedded "guided help" in the actual application is a much more
    useful form of training than working through a simulation.
    (3) It will greatly help my client's support staff and
    training staff
    I've been researching process embedded e-learning and guided
    help for almost a year now. I've looked at everything from
    multimedia authoring to macro software. I even found two programs
    that do exactly what I want, but they are very very expensive, much
    more expensive than Director.
    Thanks for the tip on Hook Xtra; I'll check that out. Last
    night I found an xtra called MasterApp, which may also do what I
    need. I appreciate the concern about the difficulty of programming,
    and I'm not a programmer (except HTML, and we all know how easy
    that is). But I'm in this for the long haul, and would be using it
    for potential new clients, not just my current client. I love
    learning new software, and I have a membership to the IEEE Computer
    Society, which gives me over 1300 online e-learning courses I can
    take, including Director.
    Thanks again for the lead!
    Mike

  • TextEdit Applescript help counter of certain words

    I have tried to modify a script that finds and replaces text. My goal is to count the instances the script finds a word, say "love", and spit out the number of instances that the word "love" appears in the document so I can use it for another subroutine. Any help is appreciated.
    I have this as guideline but it seems it does not work.
    tell application "TextEdit"
    set myCountSign to text of document 1
    set myCount to count myCountSign
    repeat with this_word in myCountSign
    if (this_word as string) is "love" then
    set myCount to myCount + 1
    end if
    end repeat
    myCount
    end tell

    The most obvious problem with your script is the line:
    repeat with this_word in myCountSign
    This looks at myCountSign (a block of text) and iterates through it assigning each text object to this_word.
    The problem is that by default each 'text object' is each character therefore you're comparing each character in the text to the string 'love' which will never, ever match. Even if the word exists you'd be performing a character-by-character comparison.
    The simplest fix is to tell AppleScript to look at the words in the text, which is done simply by:
    repeat with this_word in (words of myCountSign)
    (note you might also need to do this for 'set myCount to count myCountSign' since this will return the character count, not the word count)
    There are other, more efficient ways (such as via text item delimiters):
    tell application "TextEdit"
      set myCountSign to text of document 1
      set wordCount to (count words of myCountSign)
      set {oldtids, my text item delimiters} to {my text item delimiters, "love"}
      log set keywordCount to (count text items of myCountSign) -1
      set my text item delimiters to oldtids
      display dialog "The document has " & wordCount & " words and " & keywordCount & " occurrences of the word 'love'"
    end tell
    The text item delimiters approach works by breaking the text into chunks at each occurrence of the delimiter (in this case, the string 'love'). Then all you have to do is count the number of chunks (minus 1) which is a lot quicker than counting all the words, especially for large documents.

  • Working with the MS Word iPad and other office apps: Onscreen keyboard will not minimize

    With Microsoft's announcement today of allowing limited editing capabilities in their mobile apps, I installed the updates on my iPad.  So far, everything works great...with one exception:  The onboard keyboard will not get out of the way...won't
    minimize.
    I have last year's iPad Air and was trying to use my Bluetooth keyboard with each of the MS Office IOS apps.  Consistently, across all of these apps, the keyboard would stay on the screen and the key for minimizing the keyboard had no affect, even though
    my Bluetooth keyboard was linked and working.  Any other app I use automatically removes the onscreen keyboard when the Bluetooth keyboard is detected.
    This does make the applications difficult and not much fun to use.
    Any thoughts?  Anybody else notice the same issue?
    My office has begun deploying Office 2013/365 and I know we'll have some users on iPads and other tablets, so I'm real interested in correcting this if at all possible.

    Hi,
    This forum is for general questions and feedback related to Word for Windows, I'd recommend you post your question to the Office on IPad forum:
    http://answers.microsoft.com/en-us/office/forum/office_mobile-word-os_device_ipad?tab=Threads
    The reason why we recommend posting appropriately is you will get the mostqualifiedpool
    of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Importing footnotes from Word (and making endnotes)

    I have always had great problems importing footnotes from Word. After having saved Word as an .rtf and importing the text through and Cmd/Ctrl-D the footnotes come in at the bottom of every column in the text frame.
    Is there any way of getting them to go to the end of the text whilst still keeping their numbers and the numbers in the body of the text?
    I think what I want to do is change footnotes to endnotes.
    At the moment I'm just deleting all the footnotes from each column and changing the leading to zero to close the box and then pasting all the footnotes from Word into the document as endnotes.
    This way at least I still get the superscript numbers in the text OK but it's not a very elegant solution.

    Hello Guys, Thank you so much for your answers. Sorry it took so long to get back to you, I've been really busy and I've only just got back to this job where I have all the footnotes. I tried  the Footnotes2Endnotes_v23.jsx and it worked first time!!
    This will save me countless hours with this issue. I have resorted to pasting in the text and laboriously re-entered the numbers in the past!
    Thank you Eugene and David.

  • Imported footnote from word won't be removed in indesign textbox

    I have such an annoying problem!
    I got a indesign doc from my client, they already imported the text (with styles) from word for me.
    But now, I keep having problems wit a footnotecontainer  that doesn't want to be deleted from my text box. It stays in the bottom of my indesign text box, visible with a black line.
    I tried everything I know to delete it, but goes beyond my knowledge of indesign (which is quite a lot). Does anyone have a solution for me??  
    Regards and thanks, Liek

    Liek,
    Je hebt de tekst van de voetnoot weggegooid in het vakje voor de voetnoot-tekst. Maar op de pagina zelf staat ergens nog de voetnoot-vermelding, en dus krijg je toch nog een leeg vak onderaan. Als je de vermelding weggooit verdwijnt het vak ook.
    De gemakkelijkste manier om de vermelding te vinden is dit:
    1. Klik met de tekstcursor in het onderste voetnoot-vak.
    2. Klik daarna op de rechtermuisknop om het Tekst menu op te roepen.
    3. Kies "Ga naar Voetnoot Referentie" (uh ... ik heb een Engelse versie, en daar heet-ie "Go to Footnote Reference". Je vindt het wel Hij staat min of meer in het midden van het menu.)
    4. De tekstcursor zou nu direct achter de vermelding moeten staan. 1x Backspace en hij is weg.
    Als dit niet lukt proberen we wat anders.
    (In English, for those with the same problem:
    1. Click inside the Footnote box at the bottom
    2. From the context pop-up menu, choose "Go to Footnote Reference"
    3. Select "Go to Footnote Reference", somewhere near the middle of the menu list.
    4. The text cursor moves to behind the reference. Use Backspace to delete it.
    If this doesn't work we'll have ta try something else.

  • OUTLOOK.EXE version 12.0.6668.5000 stopped interacting with Windows and was closed.

    I have an end user whose Outlook 2007 is spontaneously closing. It will enter a 'not responding' state and then shut down (and sometimes relaunch). In going through the event log the following information was obtained. O/S is Win-7, 64-Bit. Any input greatly
    appreciated.
    The program OUTLOOK.EXE version 12.0.6668.5000 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Action Center control panel.
    Process ID: 14ac
    Start Time: 01cf6af126c3ad83
    Termination Time: 79
    Application Path: C:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE
    Report Id: c7d7556f-d9dd-11e3-a17c-2cd05a89d710
    And further into the Event Log (Application)
    - System
    - Provider
    [ Name] Application Hang
    - EventID 1002
    [ Qualifiers] 0
    Level 2
    Task 101
    Keywords 0x80000000000000
    - TimeCreated
    [ SystemTime] 2014-05-12T14:03:22.000000000Z
    EventRecordID 26088
    Channel Application
    Computer uswal-3PLSJX1.amer.thermo.com
    Security
    - EventData
    OUTLOOK.EXE
    12.0.6668.5000
    14ac
    01cf6af126c3ad83
    79
    C:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE
    c7d7556f-d9dd-11e3-a17c-2cd05a89d710
    55006E006B006E006F0077006E0000000000
    Binary data:
    In Words
    0000: 006E0055 006E006B 0077006F 0000006E
    0008: 0000
    In Bytes
    0000: 55 00 6E 00 6B 00 6E 00 U.n.k.n.
    0008: 6F 00 77 00 6E 00 00 00 o.w.n...
    0010: 00 00 ..

    Hi,
    The event log in your posting is a general error event which occurs when application stops responding. Please make sure the latest patches and service packs are installed for your Outlook 2007.
    Please also restart Outlook in safe mode(Start > Run, type Outlook /safe and Enter) to check whether Outlook 2007 is still not responding or not.
    Thanks,
    Winnie Liang
    TechNet Community Support

Maybe you are looking for