How do I create a multiple find and replace for Excel in AppleScript?

I have a large dataset in Excel that I have to do a multiple find/replace in (changing USPS state abbreviations to their full names). In searching the Microsoft boards--I was directed to use Applescript, and even the documented help with Excel was recommeding this. Unfortunately, there wasn't much help potinting me in the specific direction I needed. Any ideas on how I should write this script?
Thanks!

I'm confused as to why Applescript (or any script would be helpful).
You'd have to type the abbreviation and the full name into the script, the same as just using Find and Replace All. You wouldn't gain anything by using a script. Is there more to this task than you've let on?
MacTech has an article on converting from VBA to Applescript, but I'm not sure if it would have any ideas on your specific problem: http://www.mactech.com/vba-transition-guide/index-toc.html

Similar Messages

  • "Find and Replace" for field names in a fillable PDF

    Is it possible to do a "Find and Replace" for the field names in a fillable PDF? For example, I have multiple fields that contain the word "Proposed Insured" as part of the field name and would like to find and replace all of them with "Owner". Is there an easy way to do this?

    Not really. Even a script can't just rename a field. It needs to create a
    new field on top of the old one, but then you lose all the associated
    settings, like validation, calculation, format, keystroke, etc.

  • How to use Microsoft Word's Find and Replace with HTML tags?

    Hello to all!
    I'm trying to figure out how to use the find and replace function in Word to replace html tags. I'd like to be able to change something like this:
    <span class="B01-K-ITAL">random text</span>
    To something like this:
    <em>random text</em>
    I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly.
    Anyone able to lend a hand?

    Here is my latest regular expression with Perl.   I think it matches the spirit of the request in the original post.
    Note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.
    perl -0660pe 's^<[sS][pP][aA][nN]\s+class="B01-K-ITAL"\s*>(.*?)</[sS][pP][aA][nN]>^<em>$1</em>^gs' i.html >|o.html
    input text
     <html> <head>...</head> <body>I'd like to be able to change something like this: <span class="B01-K-ITAL">#1 one line</span> I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly. <p>note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.</p> <span class="B01-K-ITAL">#2 don't be greedy</span> <span class="B01-K-ITAL">$3 multiline text</span> <span class="B01-K-ITAL">#4 multiline tag. I believe html allow a carriage return in white space of tags</span> <span class="B01-K-ITAL">#5 split after the class tag. optional white space</span> <sPan class="B01-K-ITAL">#6 mixed case tag</Span> <p>no text #7</p><span class="B01-K-ITAL"></span> <!-- Apparently, this is valid     http://www.positioniseverything.net/articles/cc-plus.html --> <!--[if IE]> <div id="IEroot"> <![endif]--> <p id="IE">This browser is IE.</p> <p id="notIE">This browser is not IE.</p><!--[if IE]> </div> <![endif]--></body> </html>
    output text
     <html> <head>...</head> <body>I'd like to be able to change something like this: <em>#1 one line</em> I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly. <p>note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.</p> <em>#2 don't be greedy</em> <em>$3 multiline text</em> <em>#4 multiline tag. I believe html allow a carriage return in white space of tags</em> <em>#5 split after the class tag. optional white space</em> <em>#6 mixed case tag</em> <p>no text #7</p><em></em> <!-- Apparently, this is valid     http://www.positioniseverything.net/articles/cc-plus.html --> <!--[if IE]> <div id="IEroot"> <![endif]--> <p id="IE">This browser is IE.</p> <p id="notIE">This browser is not IE.</p><!--[if IE]> </div> <![endif]--></body> </html>

  • How to use Find and Replace for CR or TAB

    How can I use PAGES 'Find and Replace' function to eliminate unwanted carriage returns or Tabs?
    I tried to copy the backwards P and paste into Pages find window, but that doesn't work.
    eMac   Mac OS X (10.4.4)   1 G RAM

    Copying & pasting should work, but it isn't necessary. In the Find & Replace fields hold down the Option key & hit the return or tab key.
    Peggy

  • Multiple Find and Replace

    I have a set of 8 Find and Replace Settings in DW that I need
    to perform on one file all the time. I don't know of any way to get
    them all to run at the click of a button. These actions won't
    record in the command recorder.
    Is there a way to write an extension that would perform these
    Find and Replace Commands at one click?
    Can someone please help me with this extension?
    Also if there is a way for me to make each of these find and
    replace settings a button in the object panel it would be ok also,
    that way I can choose which ones I want to perform.
    Thanks in advance.

    I have a set of 8 Find and Replace Settings in DW that I need
    to perform on one file all the time. I don't know of any way to get
    them all to run at the click of a button. These actions won't
    record in the command recorder.
    Is there a way to write an extension that would perform these
    Find and Replace Commands at one click?
    Can someone please help me with this extension?
    Also if there is a way for me to make each of these find and
    replace settings a button in the object panel it would be ok also,
    that way I can choose which ones I want to perform.
    Thanks in advance.

  • Find and Replace for XML

    I have requirements for searching through XML files and performing a number of different Find and Replace functions. They include Find and Replace:
    - on content in any element
    - on content within a specified element
    - on attribute values within a specified element
    - on attribute names within a specified element
    - on element type names themselves
    The last 2 Find and Replace types could invalidate the document. I'm thinking DOM would be most appropriate for this. Which java packages/classes/technologies are the best to use? BTW, I've got some experience with java and a little less with XML.
    Thanks....

    Hi, here is what I suggest: You can use DOM or JDOM as your tecnology. I prefer to use DOM because is the one I'm familiar with.
    For the first three assignments, you can use DOM methods to get node text, data, etc.(look for the API/examples in the web). For the 2 last assignments, you may need to use XSLT to produce the OUT put XML and in some cases use filtering and concatenation. See http://java.sun.com/webservices/docs/1.0/tutorial/index.html.
    Good luck!

  • Multiple find and replace function

    Hi all,
    Is it possible to search for more than one URL and then
    replace? For example, I have 280 or so .html files and
    all the links inside them need to be updated. So, could I
    search for URL 1, URL 2 and URL 3 and replace with New URL 1, New
    URL 2 and New URL 3 automatically?
    Any help at all is very much appreciated!

    I don't think this is possible.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "bravogolf" <[email protected]> wrote in
    message
    news:ee5t16$ae2$[email protected]..
    > *bump*
    >
    > Anybody?

  • Find and replace for multiple thin space with enter...

    Hi,
         Im new to the InDesign Scripting.  I need to replace multiple thin space with enter to single enter.  Dont know how to do.  Pls someone help me.
    Thanks in advance,
    Sudha

    Hi Sudha,
    Use the Sample code,
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    app.findChangeTextOptions.wholeWord = false;
    app.findChangeTextOptions.caseSensitive = true;
    app.findChangeTextOptions.includeMasterPages = false;
    app.findTextPreferences.findWhat = "<2009>^p";
    app.documents.item(0).findText();
    app.changeTextPreferences.changeTo = "^p";
    app.documents.item(0).changeText();
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    Regards,
    Nagaraj

  • How can I multi-find and replace relative paths to external topics?

    I am using RH7 and publishing to a company server share. External topics are saved on the same server share and linked on my local drive to create a relative link. How can I do a multi-find and replace on the relative links to change the path to the external docs? The paths do not show up in the Topics List because they are relative, not absolute. Although changing all of the many paths manually would be job security, I would like an easier fix. Thanks for any help.

    Hello again
    Likely your best bet at this point is to use a good Multi-File Find and Replace utility.
    While RoboHelp has one included, it often fails. So we typically recommend something like FAR (Find And Replace) or BKReplace.
    Click here to visit the FAR site
    Click here to visit the page for BKReplace
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Find and Replace across multiple topics

    I haven't used RoboHTML in a few years and am getting back to using it again. this is a fairly simple question, but the Help for RoboHelp doesn't seem to provide an answer.
      How do you do a simple find and replace across multiple topics?  I want to search for a text string and replace it with another text string.

    Hi,
    Have you tried to use the "Multiple File Find and Replace" option present in RoboHelp. You may access this option from Edit->Find and Replace in Files.
    Before trying to find the files, please ensure that the where field in the dialog points to the correct location of your project.
    Thanks

  • A Script to Find and Replace Layer Names

    Are there any scripts to find and replace layer names?
    There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
    The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
    Ideally, it would be great if there was something that could do multiple find and replaces in one go:
    (e.g.
    You have layers like this Car, Dog, Bat
    You enter: car(Option1), dog(Option2), Bat(Option3)
    Your layers then become: Option1, Option2, Option3).

    big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
    You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
    The usual way of working with find-change lists is to build an array:
    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
    However ..
    A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
    The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
    This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
    So this is what it looks like:
    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
    'FHairBowlBoy *Hair':'Hairboy1',
    'FHairCurlyafroBoy *Hair':'Hairboy2',
    'FHairSpikyBoy *Hair':'Hairboy3'
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    //Set up Variable to access layer name
    var currentLayer = app.activeDocument.layers[i];
    if (layernames[currentLayer.name])
      currentLayer.name = layernames[currentLayer.name];
    Enjoy!

  • Help with removing a variable number using "find and replace"

    Hey, I have to remove a variable number from a large number of documents.
    How would I do this using "find and replace"
    <text><![CDATA[Coloured 250]]></text>
    250 is an example of the variable number that I will need to remove so it looks like this:
    <text><![CDATA[Coloured]]></text>
    Note: the text "coloured" is subject to change also.
    Thanks

    That's a possibilitly I'll explore.  Thanks for the alternate perspective!
    (5 minutes later)
    Oh well, it was a good thought.
    Unfortunately each line of raw original text may contain from 1 to 4 lines of final text.  In other words there is no consistency in the number of backslashes (hard returns) in each line of original text, and thus, when backslashes are converted to commas, no consistency in the number of data elements in each data set. 
    Sadly PS variables will not handle finding a source text line that does not have data for 4 variables.  So I either have to go back and add enough commas on each short line to make four individual data elements for each data set... or I simply deal with the hard returns within Photoshop.
    I think I've reached the limit of automation on this process.

  • Find and Replace feature (DW8)

    I have 300+ pages, where every page includes an image, while
    the image could
    be the same in more than one pages.
    How can I find which images are common in which pages?
    Please note, that I wouldn't like to use Find and Replace for
    each one of
    the images, as there are more than 200 of them. I would like
    a more
    "general" expression instead. Something like "Find all the
    pages where *any*
    image file name is in more than one of them". Then, I
    (probably) get a list
    like the one below:
    image1.jpg is included in files 10.htm, 15.htm, 20.htm
    image2.jpg is included in files 30.htm, 40.htm
    image3.jpg is included in files 100.htm, 150.htm, 200.htm,
    300.htm
    ... and so on
    Is there a workaround? A regular expression... an
    extension...?
    TIA
    Please, remove hyphens to contact me

    "Michael Hager" <[email protected]> wrote in message
    news:f3pg21$22q$[email protected]..
    > Use search and replace to just find .jpg in the code for
    entire local
    > site.
    > Then in the results pane click the save icon at the left
    to save the
    > results to a file.
    >
    > It will list every .jpg file in the site, list which
    page it is in and
    > show the line of text it appears in.
    >
    > Repeat the process for .gif, .png or any other file
    types you may have on
    > your site.
    >
    > With a little creative sorting in excel you can find all
    duplicate files
    > as well.
    >
    Creative sortings need productive minds. Don't they? ;-)
    Thanks a lot!

  • Find and replace characters in file names

    I need to transfer much of my user folder (home) to a non-mac computer. My problem is that I have become too used to the generous file name allowances on the Mac. Many of my files have characters such as "*" "!" "?" and "|". I know these are problems because they are often wild cards (except the pipe). Is there a way that I can do a find and replace for these characters?
    For example, search for all files with an "*" and replace the "*" in the file name with an "@" or a letter? I don't mind having to use the terminal for this (I suspect it will be easier).
    Is this possible? Does anyone have any suggestions?
    Thank you in advance for any help you may be able to provide.
      Mac OS X (10.4.8)  

    Yep.
    "A Better Finder Rename" is great for batch file renaming.
    http://www.versiontracker.com/dyn/moreinfo/macosx/11366
    Renamer4mac may be all you need.
    Best check out VersionTracker. In fact everybody should have this site bookmarked and visited daily.
    http://www.versiontracker.com/macosx/

  • Using + and - keys to change dates and times; Find and Replace event

    Hi all, \
    I have two iCal related questions. One has been bugging me since the Snow Leopard upgrade and the other I'm just wondering about.
    1. Is it just me or is it no longer possible to use the + and - keys to increment dates and times when editing an event? It seems that now I have to actually type in the numerals instead. Is there something in the preferences I'm missing or is that just the way it is now? Seems like a step backward, if so.
    2. Is there a way to do a "find and replace" for an event that occurs sporadically throughout the year, but isn't a repeating event per se? I just want to rename the event itself.

    Don,
    ...is it no longer possible to use the + and - keys to increment dates and times when editing an event?
    I did not know that was possible. Try using the ↑/↓ arrow keys to increment numbers, and →/← arrow keys to change fields.
    Is there a way to do a "find and replace" for an event that occurs sporadically throughout the year, but isn't a repeating event per se?
    AFAIK, you have to use the search field to find the individual events, and change them when you click on the events in the search results field.
    ;~)

Maybe you are looking for

  • Drive won't read any dvd .. ejects it automatically after spinin some time

    My MBP is just some 2 months old and suddenly it has stopped recongnizing/reading the dvds, they dont even show up on the desktop, dont even read a blank dvd. it spins for some time with a noise and then ejects it out by itself. it is doing this for

  • Moving music from my nomad jukebox zen xtra to my

    I am trying to move my music from my nomad jukebox zen xtra to my pc - i cant get the creative media source to recognize my player - i tried windows media player and comcast rhapsody - it recognized my player but wont let me highlight music to move t

  • Invalid Materialized view Oracle 8

    Hi, I have a problem with a Invalid materialized view in Oracle 8. this view is in a .sql file. When the SQL file runs and the view is invalid the the loading is stopped. Does anyone know if it's possible in Oracle 10 that Oracle solves the problem (

  • Why is google doing this to my site?

    Hello! Ok I have a site finally that I did: www.hopeproject.co.za But for some reason i cant get google to say what I want it to say if I search my name. See attached google image. What I want to say is: The artwork of Wesley van Eeden including illu

  • SAP ABAP

    Hi Friends, In my Z program i am calling one tcode FPBMC and i am not doing this by call trasaction and instead of that i am opening a job and then submitting the report for that particular TCode FPBMC by passing all the required data and there after