Is there a "remove duplicates" script for Numbers?

Is there an Numbers script that will remove (or flag) duplicates from a list of email addresses?

No bult in script, although there may be one floating around somewhere in cyberspace.
Flagging duplicates is pretty easy, though:
Formula:
B2, and filled down: =COUNTIF(A,A2)
Sort the table (descending) on column B ("Count") to bring all the addresses with duplicates to the top.
Delete the extra copies of each address reporting more than one copy.
Regards,
Barry

Similar Messages

  • Remove Duplicate Rows in Numbers 09

    Is there a way to remove duplicate rows in Numbers 09? For example I have 2 Tables and the values of Column A are mainly the same, but there are definitely a few dozen unique values in 1 table which are not in table 2 and visa versa. I'd like to make a new table with a column A with all of the values, but with duplicates removed so that I can then compare the values of a different column based on the value of Column A for each table.

    I copied tabeau 1 and tableau 2 in tableau 3 then in cell E2 of tableau 3 I entered the formula:
    =COUNTIF($A$1:$A1,"="&A)
    Using fillDown, I filled the column E
    I get 0 if the cell a is unique
    I get 1 (or higher) if the cell is available several times.
    Sort upon column E
    delete the rows whose cell E is not 0.
    Yvan KOENIG (VALLAURIS, France.) samedi 22 août 2009 11:08:15

  • Is there any upgrade checking script for PL upgrade

    Dear Experts,
    I know there are Pre-upgrade checking script to validate database integrity before an upgrade from 2005 to 2007.
    However, is there any such similar scripts for an upgrade from 2007 PL12 to PL13? (Inter PL upgrade) or can I use the same script for the same purpose?
    Much Thanks!
    Warmest Regards,
    Chinho

    Hi Gordon,
    Thank you for your reply. Is it true that within inter-patch upgrades, there are no database structure change?
    I asked this question because sometimes I get "DB is inconsistent" error after upgrade, and I don't know why?
    Much Thanks for your Advice thus far!
    Warmest Regards,
    Chinho

  • Script for Numbers

    Hi,
    Struggling with Numbers.  I believe the solution lies in an applescript.  Unfortunately I'm not really familiar with applescript.  So, for me, it's like inventing the wheel.
    What I would like is this : a table in which I enter a row of data (dates, names, codes, text, etc).  Then via a button or (preferably) a code I want this row to be copied, in another (secured) table an additional row opened and to be filled with this data.  Would be nice if the data in the first table could be cleared after that.  Not essential.  Is this possible with applescript?  If so, can someone give me something to get me started?
    Thanks
    Marcel

    Hello
    Here's the requested script.
    Specify the destination folder's POSIX path in variable dst in _main(). Currently it is set to ~/Desktop/test. Note that ~ (tilde) notation for home directory is NOT supported in AppleScript. The pdf name is obtained from sheet 6's table 1's cell "C5". Note that : (colon) cannot be used in HFS file name and so it is replaced with . (period) here.
    Tested with Numbers v2.0.5 under OSX 10.6.8.
    Hope this may help,
    H
    PS. If you're using 10.9, it appears very complicated to enbale GUI scripting for applets or services due to its demanding kindergarten requirements.
    cf.
    http://macosxautomation.com/mavericks/guiscripting/index.html
    _main()
    on _main()
        set dst to (path to home folder)'s POSIX path & "Desktop/test" -- # POSIX path of destination directory (predefined)
        --set dst to (choose folder with prompt "Choose destination folder")'s POSIX path -- # or choose destination directory at run-time
        set p2d to (path to desktop)'s POSIX path -- POSIX path of desktop
        -- (1) save table as pdf on desktop
        tell application "Numbers"
            tell document 1
                tell sheet 6
                    tell table 1
                        --set pdfname to (cell "C5"'s value as Unicode text) & ".pdf" -- [1]
                        set pdfname to my copy_as_text(cell "C5") & ".pdf" -- to get displayed value; # see [1]
                        set pdfname to my _gsub(pdfname, ":", ".") -- [2]
                        my select_table(it)
                        set pdfname_used to my save_selection_as_pdf(pdfname, {_replace:true})
                    end tell
                end tell
            end tell
        end tell
        -- (2) move saved pdf to destination directory (replacing existing file)
        set pdfname_used_posix to _gsub(pdfname_used, "/", ":") -- [3]
        do shell script "mv -f " & (p2d & pdfname_used_posix)'s quoted form & " " & dst's quoted form
            [1] (cell's value) property can be different than displayed value and there's no (cell's displayed value) property;
                thus the only way to get cell's displayed value is to select the cell, perform copy, and get value from clipboard.
            [2] : (colon) is reserved in HFS path; here it is replaced with . (period).
            [3] / (solidus) is reserved in POSIX path; / in HFS path is to be represented by : (colon) in POSIX path.
    end _main
    on save_selection_as_pdf(pdfname, {_replace:_replace})
            string pdfname : output pdf file name (pdfname = "" denotes default name, e.g., "Untitled.pdf")
            boolean _replace : true to replace existing pdfname, false otherwise
            return string or boolean : pdf name actually saved in if operation is not canceled, false otherwise
            * pdf file is saved in ~/Desktop
            * pdf name actually saved in may be different than the given pdfname, e.g., : is replaced with - by Preview.app
            * return value is false iff _replace = false and pdfname already exists
        script o
            property _canceled : false
            property _preview_was_running : application "Preview" is running
            -- (1) copy current selection
            tell application "Numbers"
                my _keystroke(it, "c", {command down}, 0.2) -- copy current selection
            end tell
            -- (2) make new pdf document from clipboard in Preview.app
            tell application "Preview"
                my _keystroke(it, "n", {command down}, 0.2) -- new pdf document from clipboard
                my _keystroke(it, "s", {command down}, 0.2) -- save
            end tell
            -- (3) save front pdf document in Preview.app
            tell application "System Events"
                tell process "Preview"
                    keystroke "d" using {command down} -- desktop
                    tell (window 1 whose subrole = "AXStandardWindow")
                        tell sheet 1 -- save sheet
                            if pdfname ≠ "" then set text field 1's value to pdfname
                            set pdfname_used to text field 1's value
                            click button 1 -- Save
                            delay 0.1
                            repeat while exists
                                delay 0.2
                                tell sheet 1 -- alert sheet (already exists)
                                    if exists then
                                        if _replace then
                                            click button 1 -- Replace
                                        else
                                            click button 2 -- Cancel
                                            set _canceled to true
                                        end if
                                    end if
                                end tell
                                if _canceled then click button 2 -- Cancel
                            end repeat
                        end tell
                    end tell
                end tell
            end tell
            -- (4) close or quit Preview.app
            tell application "Preview"
                if _preview_was_running then
                    my _keystroke(it, "w", {command down}, 0.2) -- close
                else
                    my _keystroke(it, "q", {command down}, 0.2) -- quit
                end if
                if _canceled then my _keystroke(it, space, {}, 0.2) -- don't save changes; # see [1]
            end tell
            -- (5) activate Numbers.app
            tell application "Numbers" to activate
            if not _canceled then
                return pdfname_used
            else
                return false
            end if
        end script
        tell o to run
            [1] this may not work as expected or even fail under 10.7 or later due to its auto-save behaviour.
    end save_selection_as_pdf
    on copy_as_text(_range)
            reference _range : target range
            return string : copied value of the range
            * this handler destroys the current contents of clipboard
            * this handler will change the current selection range to _range
        tell application "Numbers"
            set _table to (_range as record)'s every reference's item 1
            set _sheet to (_table as record)'s every reference's item 1
            my select_sheet(_sheet) -- [1]
            tell _table
                set selection range to _range
            end tell
            my _keystroke(it, "c", {command down}, 0.2)
        end tell
        the clipboard as Unicode text
            [1] this is required to swtich current sheet
    end copy_as_text
    on select_table(_table)
            reference _table : table object of Numbers
        tell application "Numbers"
            set _sheet to (_table as record)'s every reference's item 1
            my select_sheet(_sheet) -- [1]
            tell _table
                set selection range to cell 1
            end tell
            my _keystroke(it, return, {command down, control down}, 0.2)
        end tell
            [1] this is required to swtich current sheet
    end select_table
    on select_sheet(_sheet)
            reference _sheet : sheet object of Numbers
        set _name to _sheet's name
        tell application "System Events"
            tell process "Numbers"
                set frontmost to true
                tell (window 1 whose subrole = "AXStandardWindow")
                    tell splitter group 1
                        tell splitter group 1
                            tell scroll area 1
                                tell outline 1
                                    tell (row 1 whose group 1's static text 1's value = _name)
                                        set selected to true
                                    end tell
                                end tell
                            end tell
                        end tell
                    end tell
                end tell
            end tell
        end tell
    end select_sheet
    on _keystroke(_app, _key, _modifiers, _delay)
            reference _app : application reference
            string _key : character(s) to be keystroked [1]
            list _modifiers : list of modifier key to be pressed; enumerations are
                    command down
                    option down
                    shift down
                    control down
            number _delay : post-delay amount [sec]
            [1] Character must be present on the current keyboard layout. Otherwise, it is replaced by 'a'.
        tell _app to activate
        tell application "System Events"
            tell (process 1 whose bundle identifier = (_app's id))
                keystroke _key using _modifiers
            end tell
        end tell
        if _delay > 0 then delay _delay
    end _keystroke
    on _gsub(t, s, r)
            string t, s, r : source string, search string, replace string
            return string : every occurence of s being replaced by r in t
        return _join(r, _split(s, t))
    end _gsub
    on _split(d, t)
            string or list d : separator(s)
            string t : source string
            return list : t splitted by d
        local astid0, tt
        try
            set {astid0, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {} & d}
            set tt to t's text items
            set AppleScript's text item delimiters to astid0
        on error errs number errn
            set AppleScript's text item delimiters to astid0
            error errs number errn
        end try
        return tt
    end _split
    on _join(d, tt)
            string d : separator
            list tt : source list
            return string : tt joined with d
        local astid0, t
        try
            set {astid0, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {} & d}
            set t to "" & tt
            set AppleScript's text item delimiters to astid0
        on error errs number errn
            set AppleScript's text item delimiters to astid0
            error errs number errn
        end try
        return t
    end _join

  • Is there any personal finance template for Numbers?

    I am looking for some simple, streamlined personal finance template for Numbers and I was wondering if anyone knew of any to download.
    Thank you!

    Kane,
    Is this what you had in mind?
    http://www.numberstemplates.com/images/Checking-Register.jpg
    If so, you can download it here:
    http://www.numberstemplates.com/2007/08/23/template-checking-account-register-fo r-apple-iworks-numbers-08/
    - Michael

  • Hello, is there any removable hard drives for the iPad?

    Does anyone know if there is a removable hard drive that can be used with an iPad, ie backing up working emails from my laptop but being able to access them on the iPad from the hard drive?

    Thanks, the problem I have is, I access a lot of archived emails on my laptop but as we all know this is quite a long winded thing to do when you have to switch a laptop on and off thought out the day.
    Thanks for your help.

  • Is there a difference in scripting for Adobe Reader 8.0

    Hi,
    I started to create Interactive forms with Adobe Reader 7.0 installed on my machine. I had problems with dynamically growing text field so when I searched the forum, it was suggested that it is a problem for the Adobe versions 7 and lesser so I installed Adobe Reader 8.0 on my system but after installing that lots of scripts stopped working.
    An example is that the following print comman is not working now.
    xfa.host.print(1, "2", "2", 0, 1, 0, 0, 0); - I am trying to print the 3rd page.
    Can anyone tell me if the scripting has changed because it was working fine till I installed the newer version of Adobe.
    Thanks,
    Kalyan

    Hi Kalyan,
    No idea about Abode reader 8.0 but i suugest try to use Adobe reader 7.1.
    your scripts should work on 7.1. You can test the client side scripts using adobe life cycle designer standalone.
    Nanda

  • Is there an alternative html script for embedded forms?

    I recently read the guidelines on embeding forms on a site:
    http://forums.adobe.com/docs/DOC-1991
    Previously we were using iFrame but the trouble-shooting guide suggested to use the code generated from the distribute tab. However, I noticed it used the scipt html tag which is prohibited on the site I'm using to display the form. What other alternatives are there to overcome this issue to enable to have the form correctly displaying on the site?

    Sorry this change has caused you issues. We’ve had a lot of people embedding forms improperly. When it’s done without the embed code the form often doesn’t work properly (its cropped on the side/bottom, submit doesn’t work, etc). Because of that, we now catch the improperly embedded form and tell people the right way to embed it. 
    I’m talking with my engineering team to see if there is anything we can do.
    Randy

  • Super-scripted Ref Numbers with generated Ref Table (A Glossary?)

    Good Morning All!
    I have been trying to create a paragraph style that will be applied manually, but when applied Italicizes and adds a sequential super-scripted "reference number". These reference numbers will then be used to produce a table which will sort rows numerically and produce info based on each reference. I will also need this to delete duplicates. I have a remove duplicates script for my ToC and may be able to retrofit it to this, but we'll get to that later. I can single out words with GREP, but without creating my own "parts dictionary" it would be a pain to add a thousand or so part names* to a GREP. I figured the easiest way to do this would be to manually apply a paragraph or character style per instance and then use a script to remove duplicates. If there is a better way to do this I'm open to suggestions.
    *Sadly part names aren't always consistent either due to different writers writing styles.
    To keep it simple for now I'm wanting it to just produce: Example Row in Table - [Ref # / Blank cell for part number / Part Name (Text that Ref style was applied to) / Blank cell for description]
    Example:
    I'm running into a problem that my super script numbers wont sit right if its done through a paragraph style as it reads the entire paragraph. I need the style to apply to a word or group of words. I tried creating a numbering system like a ToC, but once again that works off of paragraph styles. I can manually apply a character style but it doesn't have any sequential numbering options. For right now I'm fine manually applying the style for each instance and then copy/pasting part number and description. I'm just looking for something to generate reference numbers and the name that coincides into a row of a target table. In the future it would be amazing to have it access the component dictionary (excell doc) I'm painstakingly building to grab the part number(s) and descriptions so I don't have to copy/paste.
    I have been tasked with making multiple writers write the same thing. It feels impossible btw. So I have been creating an indesign template that does a lot of the work for you so that the largest inconsistencies are now handled by Indesign and leave no room for user error. This will not only help my older writers be consistent but will lessen the learning curve on newbies. Let me know if there is something differently I could be doing or if anything has worked well for you. I am open to any and all help/suggestions, I look forward to hearing back!

    Thanks for the quick response Pete. They would need to be created as well. 
    I was hoping that they would continue on through pages, but not documents (for booked instances). That they would be numbered on the fly so that if you moved pages around they would renumber themselves and then you could run a script to fix the order in the table. I have the sequential numbering scheme down for automatic figure box numbering. I just cant figure out the in-text mid-paragraph numbering. What do you have for me MVP?

  • How to remove duplicate POP messages in Mail under Mavericks

    Hello
    I'm having some significant problems with Apple Mail, and despite having researched widely, I haven't been able to find a solution yet. Here is my tale of woe...
    My set up is that I use Mail with 5 separate accounts, downloading all messages using POP. I keep ALL my mail (even the trash) so that I have a permanent record of all conversations, going back more than 10 years - this is about 250,000 emails in around 250 subfolders. I'm running the latest version of Mavericks on a 2010 MBP. I have no intention of moving to IMAP - I need to keep a local archive of all my mail.
    A few months ago I was having problems with Mail being very slow to load and search emails. I decided to rebuild the mailboxes, but afterwards discovered that thousands of messages in the inbox of one of my accounts (and some of the sub-folders) had disappeared. Once I realised I tried to go back to a recent Time Machine back up, but, for whatever reason, that part of the back up hadn't worked properly and I was unable to recover the previous status. I left it while I decided what to do, and had time to deal with it...
    The last 2 years worth of emails on that account were still archived on gmail, so last week I decided to try redownloading the whole lot (something like 72,000 messages), and then planned to use one of the scripts I was aware of to remove the duplicates to the trash, and then remove any duplicates in the trash forever. That ought to mean I at least had an archive of the last two years of missing messages, even if I had no record of which ones had been flagged or replied to, etc.
    The downloading took about 24 hours to complete, and I now have almost 70,000 messages in the inbox of that account. I also rebuilt all the folders again, which doesn't seem to have resulted in any further loss of messages as far as I can tell. However, I hadn't figured on two things:
    1. Mail 'hides' duplicate messages, meaning that all of the messages I've downloaded are showing as unread, and I can't differentiate the ones I already had in my Inbox, and the new downloads. When I click on those apparently unread messages I can see if they have been replied to or forwarded, etc, but there's no obvious way for me to remove the ones I have already dealt with to the trash, without going through them all manually, which is clearly impossible.
    2. The scripts I'd found for removing duplicates don't work. Andreas Amann's Remove Duplicates script doesn't work under Mavericks, and he has abandoned the project. I've also tried the remove-duplicate-messages.scpt made by Jolly Roger (http://jollyroger.kicks-***.org/software/), and while it *sometimes* works on individual subfolders on my Mac (but as far as I can tell removes the duplicate in that folder, rather than the newly downloaded version), mostly it doesn't work at all - it creates a 'Remove Duplicate Messages' folder on my desktop, a log inside it and a folder for removed messages, but nothing appears in the duplicates folder.
    So, I'm left in a position where I have 70,000 apparently unread messages in my Inbox, a massively bloated Mail library (which has pretty much doubled in size, because of the 'hidden' messages), a slow and unresponsive Mail program. I've come to the conclusion that there must be some corrupted email somewhere, which probably caused the original email haemorrhage, and may still be causing the inability to remove duplicates. Mail is so slow as to be almost unuseable.
    I figure I have a number of options:
    1. I could live with the situation and just archive most of the Mail in my inbox, with the side effect that there will be a bunch of messages I have never replied to that are missed.
    2. I could abandon the last week's efforts and revert to the version of Mail I was using a week ago, and then redownload the recent emails from my various accounts. That would still leave me without those thousands of emails I lost on my local machine.
    3. I could find another way to deal with this. Can I get the remove duplicates script working? Should I revert to the version of Mail from a week ago, download ALL the messages again, but do it in a way that allows me to find the duplicates and remove them? Should I move to another email program altogether (which would presumably be massively disruptive to my work!)
    Anyway, apologies for the essay length of this request, and thanks in advance for any help you may be able to offer!

    hi Eric
    thanks for the tip, but I don't think that solves my problem, which is that Mail apparently hides the duplicates, so they're still there, you just can't differentiate or remove them. I actually *need* the duplicates there so I know I've got everything, but then I need to be able to move the ones I know I've dealt with from my inbox to an archive/trash, and/or remove them completely so Mail isn't totally bloated

  • How to remove duplicate messages from Mail in Mavericks (POP)

    Hello
    I'm having some significant problems with Apple Mail, and despite having researched widely, I haven't been able to find a solution yet. Here is my tale of woe...
    My set up is that I use Mail with 5 separate accounts, downloading all messages using POP. I keep all my mail so that I have a permanent record of all conversations, going back more than 10 years - this is about 250,000 emails. I'm running the latest version of Mavericks on a 2010 MBP. I have no intention of moving to IMAP - I need to keep a local archive of all my mail.
    A few months ago I was having problems with Mail being very slow to load and search emails. I decided to rebuild the mailboxes, but afterwards discovered that thousands of messages in the inbox of one of my accounts (and some of the sub-folders) had disappeared. Once I realised I tried to go back to a recent Time Machine back up, but, for whatever reason, that part of the back up hadn't worked properly and I was unable to recover the previous status. Ileft it while I decided what to do, and had time to deal with it.
    The last 2 years worth of emails on that account were still archived on gmail, so last week I decided to try redownloading the whole lot (something like 72,000 messages), and then uplanned to use one of the scripts I was aware of to remove the duplicates to the trash, and then remove any duplicates in the trash forever. That ought to mean I at least had an archive of the last two years of missing messages, even if I had no record of which ones had been flagged or replied to, etc.
    The downloading took about 24 hours to complete, and I now have almost 70,000 messages in the inbox of that account. However, I hadn't figured on two things:
    1. Mail 'hides' duplicate messages, meaning that all of the messages I've downloaded are showing as unread, and I can't differentiate the ones I already had in my Inbox, and the new downloads. When I click on those apparently unread messages I can see if they have been replied to or forwarded, etc, but there's no obvious way for me to remove the ones I have already dealt with to the trash, without going through them all manually, which is clearly impossible.
    2. The scripts I'd found for removing duplicates don't work. Andreas Amann's Remove Duplicates script doesn't work under Mavericks, and he has abandoned the project. I've also tried the remove-duplicate-messages.scpt made by Jolly Roger (http://jollyroger.kicks-***.org/software/), and while it *sometimes* works on individual subfolders on my Mac (but as far as I can tell removes the duplicate in that folder, rather than the newly downloaded version), mostly it doesn't work at all - it creates a 'Remove Duplicate Messages' folder on my desktop, a log inside it and a folder for removed messages, but nothing appears in the duplicates folder.
    So, I'm left in a position where I have 70,000 apparently unread messages in my Inbox, a massively bloated Mail library (which has pretty much doubled in size), a slow and unresponsive Mail program. I figure I have a number of options. Either I could abandon the last week's efforts and revert to the version of

    Apologies, this was posted here in error. Please find updated post here: https://discussions.apple.com/message/27261965#27261965

  • Removing duplicate emails in Mail

    While attempting to back up my Gmail -- which is at capacity right no -- I accidentally reset the POP setting and downloaded all my mail again.
    So now I have 160000+ emails in my mailbox in Mail. I would like to weed out the dupes, and after a bit of Googling, found Mail Scripts (http://www.versiontracker.com/dyn/moreinfo/macosx/16217) and started running the Remove Duplicates script.
    Everyone said it was slow, but after leaving it running all night it had found only 119 duplicates! Is there any other program that will remove the extra mail, or there some way to shorten the process? It seems like my mailbox is just too big for this script to handle.

    Just a thought, but take a look at your Mail Menu "View", select columns, then make sure it has both Date Received and Date Sent checked. Then compare duped messages and see if the date/time is the same on both. I haven't had this problem, but if the Date Received is different on the second copy of the duped email, you might be able to sort on Date Received and mass-delete the dupes...
    beadman

  • An Applescript or similar to remove duplicate messages

    As a result of the slow performance of Mail, I've just noticed that my "Sent" folder contains triplicates of all the messages that I've ever sent since November 2005. I think that this is the result of rebuilding three different mail accounts, following a technical hitch that resulted in lots of messages disappearing.
    What I want to know is: is there a way to automatically delete duplicate messages and to keep a single copy of each? There are nearly 10,000 messages in the box and I really don't want to do it manually!
    Many thanks for any advice you can offer.
    G4 Quicksilver   Mac OS X (10.4.6)  

    What you describe doesn’t make sense. It looks like you’ve set up the same mail account multiple times and that the multiple copies are just the same message appearing in each of the accounts. Anyway, to answer your question, Andreas Amann’s Mail Scripts has a Remove Duplicates script that may or may not be what you’re looking for.
    Before you start deleting anything, however, quit Mail and make a backup copy of the ~/Library/Mail folder, just in case something goes wrong while trying to solve the problem. You can do this in the Finder by dragging the Mail folder to the Desktop while holding the Option (Alt) key down, for example. This is where all your mail is locally stored.
    Also, check that the multiple copies of those messages are really independent of one another, i.e. that deleting one of them doesn’t cause the others to be deleted as well.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

  • Script for export all text in single rtf file?

    Hi!
    I need to export all storys from indd document to a single rtf file. Is there avaible some free script for CS4 which can do that?

    if(app.documents.length != 0){
         if(app.documents.item(0).stories.length != 0){
              myGetFileName(app.documents.item(0).name);
    //========================= FUNCTIONS ===========================
    function myGetFileName(myDocumentName){
         var myFilePath = File.saveDialog("Save Exported File As:");
         if(myFilePath != null){
              myDisplayDialog(myDocumentName, myFilePath);
    function myDisplayDialog(myDocumentName, myFilePath){
         //Need to get export format, story separator.
         var myExportFormats = ["Text Only", "Tagged Text", "RTF"];
         var myDialog = app.dialogs.add({name:"ExportAllStories"});
         with(myDialog.dialogColumns.add()){
              with(dialogRows.add()){
                   with(dialogColumns.add()){
                        var myExportFormatDropdown = dropdowns.add({stringList:myExportFormats, selectedIndex:0});
              with(dialogRows.add()){
                   var myAddSeparatorCheckbox = checkboxControls.add({staticLabel:"Add separator line", checkedState:true});
         var myResult = myDialog.show();
         if(myResult == true){
              var myExportFormat = myExportFormats[myExportFormatDropdown.selectedIndex];
              var myAddSeparator = myAddSeparatorCheckbox.checkedState;
              myDialog.destroy();
              myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator);
         else{
              myDialog.destroy();
    function myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator){
         var myPage, myStory;
         var myExportedStories = [];
         var myTempFolder = Folder.temp;
         var myTempFile = File(myTempFolder + "/tempTextFile.txt");
         var myNewDocument = app.documents.add();
         var myDocument = app.documents.item(myDocumentName);
         var myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});
         var myNewStory = myTextFrame.parentStory;
         for (var i = 0; i < myDocument.pages.length; i++) {
              myPage = myDocument.pages.item(i);
              for (var t = 0; t < myPage.textFrames.length; t++){
                   myStory = myPage.textFrames[t].parentStory;
                   if (!IsInArray(myStory.id, myExportedStories)) {
                        //Export the story as tagged text.
                        myStory.exportFile(ExportFormat.taggedText, myTempFile);
                        myExportedStories.push(myStory.id);
                        //Import (place) the file at the end of the temporary story.
                        myNewStory.insertionPoints.item(-1).place(myTempFile);
                        //If the imported text did not end with a return, enter a return
                        //to keep the stories from running together.
                        if(i != myDocument.stories.length -1){
                             if(myNewStory.characters.item(-1).contents != "\r"){
                                  myNewStory.insertionPoints.item(-1).contents = "\r";
                             if(myAddSeparator == true){
                                  myNewStory.insertionPoints.item(-1).contents = "----------------------------------------\r";
                   } // if not exported
              } // for text frames
         } // for pages
         switch(myExportFormat){
              case "Text Only":
                   myFormat = ExportFormat.textType;
                   myExtension = ".txt"
                   break;
              case "RTF":
                   myFormat = ExportFormat.RTF;
                   myExtension = ".rtf"
                   break;
              case "Tagged Text":
                   myFormat = ExportFormat.taggedText;
                   myExtension = ".txt"
                   break;
         myNewStory.exportFile(myFormat, File(myFilePath));
         myNewDocument.close(SaveOptions.no);
         myTempFile.remove();
    function myGetBounds(myDocument, myPage){
         var myPageWidth = myDocument.documentPreferences.pageWidth;
         var myPageHeight = myDocument.documentPreferences.pageHeight
         if(myPage.side == PageSideOptions.leftHand){
              var myX2 = myPage.marginPreferences.left;
              var myX1 = myPage.marginPreferences.right;
         else{
              var myX1 = myPage.marginPreferences.left;
              var myX2 = myPage.marginPreferences.right;
         var myY1 = myPage.marginPreferences.top;
         var myX2 = myPageWidth - myX2;
         var myY2 = myPageHeight - myPage.marginPreferences.bottom;
         return [myY1, myX1, myY2, myX2];
    function IsInArray(myString, myArray) {
         for (x in myArray) {
              if (myString == myArray[x]) {
                   return true;
         return false;
    This is a revised version of the script --  not totally tested.
    Kasyan

  • How to remove duplicate entries from Settings General iTunes Wi-Fi Sync?

    On my iPhone under Settings > General > iTunes Wi-Fi Sync there is a duplicate entry for my Mac. One is active, the other one shows options greyed out, as if it can't see the Mac on the network (although it's the same name). Is there a way to manually remove that entry from the iPhone?
    I am running iOS 7.0.4, and OS X 10.9.1, iTunes 11.1.3 on the Mac.

    iPhone 3G doesn't support Wi-Fi sync or IOS 5.1.1. You have to connect to iTunes using the dock connector to sync.
    Unless you have a iPhone 3GS or jailbroken.

Maybe you are looking for