Apple script to replace content in specific folders with folder names in csv

Can anyone please help me with this scenario... It would greatly be appreciated!
1. I have a list in csv containing 3 columns: Column 1 = Folder name • Column 2 = Entry A • Column 3 = Entry B
2. I have 100 folders named the same as Column 1.  in each folder there is different files.
This is what I need.
I need the script to to find the folder based upon column 1.
Then the script should search for place holder named "Entry A" and replace it's contents with data from Column 2.  There are several files with in the folder that contain place holder "Entry A" so it should replace it all but must remain with in that folder.
Then same for column 3 find place holder named Entry B and replace.
Then it should save all files.
Any help is greatly appreciated!  Thank you!

Can anyone please help me with this scenario... It would greatly be appreciated!
1. I have a list in csv containing 3 columns: Column 1 = Folder name • Column 2 = Entry A • Column 3 = Entry B
2. I have 100 folders named the same as Column 1.  in each folder there is different files.
This is what I need.
I need the script to to find the folder based upon column 1.
Then the script should search for place holder named "Entry A" and replace it's contents with data from Column 2.  There are several files with in the folder that contain place holder "Entry A" so it should replace it all but must remain with in that folder.
Then same for column 3 find place holder named Entry B and replace.
Then it should save all files.
Any help is greatly appreciated!  Thank you!

Similar Messages

  • If it is possible a scripting can making contents of a book with the correct page numbers?

    I was wondering if it is possible a scripting can making contents of a book with the correct page numbers.
    I know indesign has already a function that can making contents in a same file, as long as some paragraph styles were indicated to make the contents.
    But if the title on the master page, it doesn’t work.
    If it is possible to make it happen on a whole book, in spite of what I choosing title was on the master page?
    Can somebody help me?
    Thanks!

    I work on one book which has 40 topic that follow immediately, each topic has a title, socalled section headed. They were put on the master page. What I want is the section headed and the each topic's starting number to make a contents.
    Each time, I work on this kind of book, I have to copy them 40 times to make a contents page, and I have to writing down the each section's starting page number and then type in the contents.
    I was wondering if it is a function can help me and let me easily to make a contents.
    can somebody help me
    thanks!

  • Managing and distributing Folders with folder actions to a group of users?

    I want to set up a server for a camera club on a SnowLeo Server running on a MacMini. We want to collect images every month from users who want to participate in a club competition and are looking into the FileSharing service on the server to collect the images.
    My initial idea was to find a way of letting the Administrator automatically create folders with folder actions in every users home folder (i.e. "2010-April-Portraits"). After the user had uploaded images into it, the folder action would then rename, reformat and transport images into a central location to be processed further.
    Is this a good way of collecting data, and if yes - how do I let the Admin create and distribute these folders with the appropriate actions?
    Best regards,
    Kjell Are Refsvik
    Norway

    Hi,
    I want to purchase a Macmini with SL Server and create a photo competition solution for a camera club. The solution needs to be able to accept uploaded images and the solution needs to let the user associate a set of images to a competition and from there the solution needs to make sure that the filename, format, size and embedded metadata is correct before storing and processing them further. Friends I have talked to say I need a classic CMS solution so I may need to investigate instead of my planned AppleScript/Automator solution.
    Also - thank you for offering to develop, but I had kinda planned to do this myself to build some knowledge and also get to know the server better.
    Anyone else using the SnowLeo server for a solution like this?
    Kjell Are Refsvik
    Norway

  • Poweshell script to parse a XML document to get all Leaf level nodes with Node names in CSV

    Hi Experts,
    I want to write a Powershell script to parse a XML document to get all Leaf level nodes with Node names in CSV
    <?xml version="1.0" encoding="UTF-8"?>
    <CATALOG>
       <CD>
          <TITLE>Empire Burlesque</TITLE>
          <ARTIST>Bob Dylan</ARTIST>
          <COUNTRY>USA</COUNTRY>
          <COMPANY>Columbia</COMPANY>
          <PRICE>10.90</PRICE>
          <YEAR>1985</YEAR>
       </CD>
    </CATALOG>
    Need to display this as
    CD_Tiltle, CD_ARTIST, CD_COUNTRY, CD_COMPANY, CD_PRICE, CD_YEAR
    Empire Burlesque, Bob Dylan,USA,Columbia,10.90,1985
    and so on..
    I do not want to hard code the tag names in the script.
    current example is 2 level hierarchy XML can be many level till 10 max I assume
    in that case the csv file field name will be like P1_P2_P3_NodeName as so on..
    Thanks in advance
    Prajesh

    Thankfully, I have writtenscript for ths same $node_name="";
    $node_value="";
    $reader = [system.Xml.XmlReader]::Create($xmlfile)
    while ($reader.Read())
    while ($reader.Read())
    if ($reader.IsStartElement())
    $node_name += "," + $reader.Name.ToString();
    if ($reader.Read())
    $node_value += "," + $reader.Value.Trim();
    Thanks and Regards, Prajesh Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

  • Writing apple script to perform actions on specific network shares/servers

    Hi Everyone,
    I'm new to posting to this forum, but had a few simple questions about writing Apple Script. I've created a few network shares on our home network, and wrote an apple script to automatically mount the shares upon login. However, there's 2 things I'm missing:
    1. how to add a password feild to the script, along with the username.
    2. how to make the resulting application from the script (or the script itself) ignore the errors that result when i am not at home, and the server is not available (basically I'm saying I don't want to see those errors pop up)
    3. I also don't want to see the error from the network agent, about the server being unavailable.
    Any help with this would be greatly appreciated. Here is my script so far:
    tell application "Finder"
              mount volume "smb://mediaserver/automatically add to iTunes/" as user name "Rocco Fiorentino"
              mount volume "smb://mediaserver/shared media" as user name "Rocco Fiorentino"
    end tell
    Thank you in advance for any assistance. Have a great day!

    John Holley NZ wrote:
    More importantly I have found that the names in the list don't match the descriptions!
    Let's take one update for example, 061-3405 Pro Application Update 2007-01.
    Although this completely defies logical explanation, If you resist sorting the list by anything (i.e. the default random order), the descriptions will in fact be correct. This is something I see from time to time with new Excel users when they try to sort related columns for the first time and forget to select all of the relevant data, but I am totally perplexed as to why this is happening here. It seems as though the descriptions are not actually part of the file, and as such, cannot be sorted (or don't follow around the original file).
    For example, on my server, QuickTime Broadcaster 1.5 is followed by Logic Express 7.2.1. If I sort by name, the list starts with an Airport updater, but the first 2 descriptions remain the SAME (QT and Logic)! As I previously stated: this defies all logic and reason.
    For me, this seems to be a cosmetic problem; the software update server is successfully serving updates to clients. It is, however, annoying.
    Something seems seriously screwed here! I will keep digging but this does not fill me with confidence.
    John

  • How can I set my Mac to only share SPECIFIC folders with Win7

    It used to work, but, even though I have set only my Public folder and a specific photographs folder to share with a Win7 PC on my home network, the Win7 machine can see the entire Mac HD.
    I followed instructions from here:
    http://www.trickyways.com/2011/07/file-sharing-mac-os-x-lion-and-pc-windows-7/
    But if I type Run then enter the ip address of the Mac, all the folders appear. Is there a way to limit them to only the two specific folders?
    I've mapped the single folder to a drive, so admittedly, unless you go into "Run", you can't see the other Mac folders and drives, but I'd still like to make sure it can't be done.
    Thanks

    Welcome to the Apple Community.
    Cricket66 wrote:
    ........ How can I set photo stream to only upload specific images?
    That's not possible unfortunately.

  • How do I stop Apple Script from leaving a Text.txt file with each image downloaded using Photo Downloader in Adobe Photoshop CS4_Bridge???

    I use Adobe Photoshop CS4_Bridge _Photo Downloader to import images from CF Cards into my 11" Mac Book Air.  I have an issue with the Text files
    that seem to accompany each and every image that I do not need.  How do I stop Apple Script (which I assume is the culprit in this case)  from interferring with this process.

    Your iWeb Site is stored not on your iDisk, but on a file named Domain.sites in your ~/Home/Library/Application Support/iWeb/ Folder.
    If , for whatever reason, you wipe your HD and/or lose this file (Get a new computer, Re-Install your OS, Stolen Laptop, Crashed HD, Etc.) without backing-up your Domain.sites file then you will have to re-build your iWeb sites from scratch again.
    Of course you can edit your Published HTML files in a different program such as Dreamweaver or even Text Edit. You just can't edit Published HTML files in iWeb. Not at this time at least.
    Use iWebBackup to backup your Domain file to a Blank CD or DVD. Backing up your Domain file to another folder on your computer is not fully backing it up. If your computer gets stolen you still lost the file but if you have your Domain file burned onto a CD you have a backup!
    Download iWebBackup Here
    You can use iWebExtender to automatically consolidate your files into one folder and delete multiple images.
    http://iWebFAQ.com

  • Best way to replace contents of a layer with higher res image

    I can do it, but I was wondering if there is a better way.
    Large PS file (CS6 and CC) half a dozen texture layers using low res images. Several have blend modes, transparency and even masks. I now have the same images in high res. I want to replace just the image, but not lose my blend/transparency, or masks.
    Any thoughts?
    Do I bring in the high res layer, copy the mask over etc? Then delete the original?
    Max

    Try this.
    Convert the low res images to Smart Objects. Layer > Smart Objects > Convert to Smart Object.
    The replace the contenst of the smart objects. Layer > Smart Objects > Replace Contents...
    This way you can replace the low res images with the hi res versions. Provided they are the same crop and aspect rarion your mask should be fairly good to go. I say fairly good as you may have made some adjustments (eg. feathering) based on the resolution.
    The blend modes and transparency will be unaffected.

  • Save to folders with hyphenated names

    Acrobat Pro 9.0 cannot save to folders that contain apostrophes, hyphens or other special
    characters. This is such a step backwards and is so PC oriented for a product that was originally created for the Mac and was streets ahead of the PC equivalents.
    Abobe's comment is: Unfortunately this is a product limitation that we cannot resolve.
    Why then can every other application that I use on my Mac save to folders with these characters?

    Hi alexdon.  
    What do you want a screenshot of?  A view of the internal memory or SD card showing the odd folder name?  Or a shot of the contents of the folder showing just a .nomedia file?
    As I am wondering if the long folder name is some sort of key, until I know what they are, I am a little uneasy about quoting the full folder name but (replacing the last four characters with asterisks) one of the folders on the internal memory is called.
    .HhTjqSRo6dybqDAV2ImUSRE****=

  • Script or Automator to reorder text in file/folder name

    Hello,
    Similar to this discussion: https://discussions.apple.com/thread/2632228, I would like to reorder a large number of folder names. Currently, they are set up as follows:
    "Name - Year" and would like to change them all to "Year - Name". I have over 200 folders named in this format so I need to find either a way to do this via the automator or via a script. So far I can't find what I need in the Automator. Any ideas? Thank you

    try this:
    set folderList to choose folder with multiple selections allowed
    tell application "System Events"
              repeat with thisFolder in folderList
                        set folderName to name of thisFolder
      -- assumes none of the folders have extensions, or anything aside from "Name - Year", and that there are no spaces inside the name or year
      -- it can be generalized to deal with that, if needed
                        set {oldTID, my text item delimiters} to {my text item delimiters, {" ", "-"}}
                        tell folderName
                                  set {n, d} to {first text item, last text item}
                        end tell
                        set my text item delimiters to oldTID
                        set name of thisFolder to d & " - " & n
              end repeat
    end tell

  • Automator action with dropdown to make folders with predetermined names

    Is there an action/workflow that will allow me to create Folders using a dropdown menu of predetermined names for those folders?

    I haven't seen one, and since no one has posted about one yet, I'll throw this out.
    I modified a couple of handlers I have laying around into a Run AppleScript action that will make folders from a list of names. The list can be set in a Get Specified Text action, with the "menu" being a Choose from List action:
    Tested workflow:
    1) Get Specified Text (your folder names, separated by returns) for example:
    Testing
    Another test
    My Spiffy New Folder
    2) Filter Paragraphs (Return paragraphs that are not empty)
    3) Choose from List (Prompt: Please choose folder names:)
    4) Run AppleScript:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters}
    make folders with names from a list
    input: a list of names (text items)
    output: a list of Finder items (aliases) created
    set output to {}
    set DestinationFolder to missing value -- set the destination path here if desired
    try -- verify that the path is valid
    set DestinationFolder to DestinationFolder as alias
    on error
    set DestinationFolder to (choose folder with prompt "Choose the location to make the selected folders:")
    end try
    repeat with AnItem in the input
    GetUniqueName for AnItem from DestinationFolder -- avoid duplicates
    try
    tell application "Finder" to make new folder at DestinationFolder with properties {name:the result}
    set the end of the output to the result as alias
    end try
    end repeat
    return output
    end run
    to GetUniqueName for SomeName from SomeFolder
    check if SomeName exists in SomeFolder, creating a new unique name if needed
    parameters - SomeName [text]: a name.extension to check for
    SomeFolder [mixed]: a folder to check
    returns [text]: a unique name
    set {Counter, Divider} to {"00", "_"}
    set Here to -(offset of "." in ((reverse of text items of SomeName) as text)) - 1
    set TheName to text 1 thru Here of SomeName
    if Here is -1 then -- no extension
    set TheExtension to ""
    else
    set TheExtension to text (Here + 1) thru -1 of SomeName
    end if
    set NewName to TheName & TheExtension
    tell application "System Events" to tell (get name of items of folder (SomeFolder as text))
    repeat while it contains NewName
    set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
    set NewName to TheName & Divider & Counter & TheExtension
    end repeat
    end tell
    return NewName
    end GetUniqueName</pre>
    - the output from the Run AppleScript action is a list of aliases to the folders created, if you want that information to do something with.

  • Window 8.1 Merging Files with from Folders With Same Name Together

    I notice folders with the same exact name in the same location will merge together all the files into one folder without any notice to change the name. Is there some way to change this setting? 

    If set to show folder-merge conflicts, you should get a conflict-warning dialog.
       Control Panel > Folder Options > View tab
    Clear the check box below.
    -Jerry

  • Quicktime on Windows clients can't open files in folders with long names!!

    Hi,
    we've got a really strange problem. We have an Intel Xserve with Leopard Server 10.5.4 which is sharing files over SMB. Everything works fine, except Quicktime on Windows clients (XP Pro and Vista). It looks like the length of the folder names is the problem. If a single folder in the path to the mov has a name that's longer than 8 characters, Quicktime fails with "Error -43: A file could not be found."
    x:\test1234\test.mov works
    x:\test12345\test.mov doesn't work
    Same for UNC paths. VLC on Win and Quicktime on OS X work without problems over SMB. Also the problem doesn't exist on other Samba based fileservers.
    Any ideas? Perhaps some smb.conf tweaks to fix this?
    Best regards

    Just found this post
    http://discussions.apple.com/thread.jspa?threadID=1360461&tstart=0
    Seems like a well known problem

  • Apple Script to rename single files in folders

    Hey guys, I am trying to write a script to automatically rename a lot of files.  Here is the situtation:
    I have a MainFolder with many SubFolders inside.  Inside each SubFolder is 1 word document.  Is there a way to write a script that automatically renames each of of those word documents to its folder's name.  Example.
    BEFORE:
                      -SubFolder1 - 1.doc
                      -SubFolder2 - 1.doc
    -MainFolder -SubFolder3 - 1.doc
                      -SubFolder3 - 1.doc
    AFTER:
                      -SubFolder1 - SubFolder1.doc
                      -SubFolder2 - SubFolder2.doc
    -MainFolder -SubFolder3 - SubFolder3.doc
                      -SubFolder3 - SubFolder4.doc
    Thanks.

    The following script should do what you are asking for:
    set mainFolder to choose folder
    tell application "Finder"
        repeat with thisFolder in (get folders of mainFolder)
            try
                set name of (file 1 of thisFolder whose name extension is "doc") to (name of thisFolder & ".doc")
            end try
        end repeat
    end tell
    If there's just one file in each subfolder (wich is not exactly the same as “one Word document”), you could remove the “whose name extension is "doc"” filter.

  • Mail replaces content of new messages with those of very old messages

    Hi all,
    In the last day or so, the content of new emails have been replaced by contents of old messages from long ago. The listing in the inbox stays intact, but when I view it both the message body and the from/subject/cc line (in the viewing window) is changed.
    I know this problem is specific to my computer since all of my mail displays correctly on my iPhone. This problem is also specific to one of my two email accounts-- an IMAP account from my own domain.
    Is this a cache issue? Something else?
    Thanks,
    Matt

    Hi irwincine,
    I think you'll find the info in this post useful, and might resolve your problem with mail. http://discussions.apple.com/thread.jspa?threadID=121902

Maybe you are looking for

  • Change Permissikons on Multiple Files?

    Hello, I'm a recent convert from the Windows/PC world, and so far I really like everything about Apple OS X. I'm very happy about the ease with which I can get my home sharing set up, with user accounts and access from multiple computers. But I'm hav

  • Ammount formating num{$z,zzz,zz9.99}

    Hi All Need help in formating the amount fields. Currently I am using num{$z,zzz,zz9.99} Its working fine for positive ammount value. But for negative amount its giving output as $-18,970.50 Expected out is -$18,970.50 need '-' sign before $ Thanks,

  • I'm having trouble installing 4.4 due to error, "invalid checksum"

    I have a new iMac, but same problem was happening on my macbook.  Every time I try to install 4.4, I get this error.  I even unselected validate checksums in disk utilities, still failed to install. this file is referenced with the "invalid checksum"

  • Where is the "Photoshop Help Folder" located on the Mac?

    Hi all, I am trying to install Strata 3D tryout and it is asking for the location of the "Additional How To Content" folder, inside the "Photoshop Help Folder". I cannot find the "Photoshop Help Folder"... can someone tell me where it is located? Tha

  • How to Disable the (DEFAULT) userid SAP* ?

    Hi All, I have recently installed EP6.I need to Disable the default userid ie SAP* so that I can create new user ids. So how to go about it?? Thanks in advance, Jasmine.