Filename to caption script?

I have a set of several hundred family photos that were scanned from slides and have the photo description as the filename.  Is there a script or other way of getting the filename into the Metadata Title or Caption fields?
Thanks,
Paul

Update: I made some progress on this using the EXIFTools GUI utility and using its EXIFTools Direct utility.  I can get it to write the filename into the IPTC
caption field and from there can copy and paste it up to the EXIF caption in Lightroom.
The instruction I am using is:  -iptc:caption-abstract<filename
Unfortunately this does not work as I had hoped:  -exif:caption<filename  (or  -exif:description<filename)
Thanks for the help.  It does half the job I wanted and am not that familiar in writing my own scripts.
Paul 

Similar Messages

  • Is there any way to display filenames or captions for photos?

    is there any way to display filenames or captions for photos?

    Thanks. There are so many it's very hard to see which one does what. Since I edit  on the MacBook Pro using Photoshop Elements, all I really need is a way of seeing the filenames, and secondarily re-arranging thumbnails on the iPad screen manually.

  • Changing the filenames using unix script

    Hi,
    I have a scenario where I have to change the file names on the Receiver CC using a unix script and add date and timestamp to the file name
    this is what I'll be writing to filename_01.xml I need to change that to newfilename_01_MMDDYYYY_HHMISS.xml
    the 01 in the file name is the counter, so I might having more than one file where 01,02, etc will represent the counter on the filename.
    Any help is really appreciated.
    Thanks,
    Joe.P

    you can try this
    create the field called filename in target
    use a costant and concat it with the out out of UDF( or some functon avaleiable counter) which will genereate numbers like 1,2,3,4,5,6 and send this filename_01 to the output field and use this in the variable substution to genreate the filename by the CC
    if you dnt want to send this fieldin output file then specify that fieldname in CC length as 0

  • PSE 4  Use Filenames as Captions in Slide Show

    Most of my files have meaningful filenames. However when I want to make a slide show I can't figure out how to get the filenames to display as captions so people know whats going on. Is there a way of copying the filenames to the captions field. I would hate to have to copy and paste each one.

    Justin, I am having the same problem as you. I will look into what Cyclosaurus is saying to do, but it is probably a bit complicated for my brain. One thing you can do without any coding, is to space down your captions 3 or 4 times on the page where the full size version of your picture is. Then, your captions will not have a line through them when viewing in the slideshow mode that includes the thumbnails. Also, the full truncated captions will not appear in the true slideshow. I have the first line showing and then I spaced all the rest of the description down. It is hard to explain, so here is an example that I am working on for a friend. http://www.karenmardis.com/TheJewels/Pages/The_ExpressionsCollection.html One thing to note, your page has to be at least as tall as what the longest caption will need. It's a bit clumsy but it worked for me. Hope that is helpful.

  • Escaping filename in bash script

    What is the easiest way to escape a file name in a bash script? Any legal character can be in the name.
    bash code:
    fileCheckSum=$( cat "${theFilePath}" "${theFilePath}/rsrc" | md5 )
    I thought that I escaped the filenames already. Guess not.
    /Users/mac/cons/see/file name varients/funies '2/file 4
    cat: /Users/mac/cons/see/file name varients/funies '2/file 4: No such file or directory
    cat: /Users/mac/cons/see/file name varients/funies '2/file 4/rsrc: No such file or directory
    Robert

    For my driver download/reboot script I use a small program available in the ncftp package off of SunFreeware called ncftpget. It's takes a URL containing username, password, hostname, and path as the commandline argument and gets the file.
    ftp://ftp.sunfreeware.com/pub/freeware/sparc/8/ncftp-3.0.1-sol8-sparc-local.gz
    Hope that helps....
    -M

  • 4.0EA1 filename uppercase in script output

    When resizing files, the script output shows the filename in uppercase, ignoring the case used as input.  The command itself executes fine, the output is just a little confusing.
    Example:
    alter database datafile '/u02/oracle/oradata/dbname/fname_11.dbf' resize 20480M;
    Script Output window shows:
    database datafile '/U02/ORACLE/ORADATA/DBNAME/FNAME_11.DBF' altered.

    This is a known issue and will be addressed for the next EA release.

  • Batch insert filename in textpath script crashes Illustrator

    Hi everyone!
    First off: I am not a programmer. Just playing around with code and trying to get it to work for a specific task:
    Here is a script made for the purpose of inserting a text with the file name in over 600 pdf files. This is suppose to work on all files in a selected folder.
    The problem: Illustrator crashes.
    A first test code worked but after a few edited files Illustrator crashed, so I tried to introduce a delay after each save in order to slow down the batch process.
    $.setTimeout(function () {sourceDoc.close(SaveOptions.SAVECHANGES)}, 1000);
    Unfortunately I did not save the working (almost working ) first test code.
    No idea what to do next. The code works if I delete this line: sourceDoc.close(SaveOptions.SAVECHANGES);
    Here is the complete script:
    var destFolder, sourceFolder, files, fileType, sourceDoc, layers, writeText, finLabel;
    // Select the source folder.
    sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to PNG', '~' );
    // If a valid folder is selected
    if ( sourceFolder != null )
    files = new Array();
    fileType = prompt( 'Select type of Illustrator files to you want to process. Eg: *.ai', '*.pdf' );
    // Get all files matching the pattern
    files = sourceFolder.getFiles( fileType );
    if ( files.length > 0 )
    for ( i = 0; i < files.length; i++ )
        sourceDoc = app.open(files[i]); // returns the document object
        layers = unlock();
        writeText = getFilename();
        finLabel = remText();
        sourceDoc.close(SaveOptions.SAVECHANGES);   //if save command line is deleted the code works   WTF???
        $.setTimeout(function () {sourceDoc.close(SaveOptions.SAVECHANGES)}, 1000); // still crashes using delay ...
    //alert( 'Files are saved as PNG in ' + destFolder );
    else
    alert( 'No matching files found' );
    function unlock()
       //get the total number of layers in the active document
    doc = app.activeDocument;
    var totalLayers = doc.layers.length;
    //looping on layers to create one artboard per layer
    for ( var i = 0 ; i < totalLayers ; i++){
        var currentLayer = doc.layers[i];
        //We don't want to deal with hidden layers
        if(currentLayer.visible == false) continue;
        //Unlock the layer if needed
        currentLayer.locked = false;
    function getFilename()
    // Write text
    var pointTextRef = app.activeDocument.textFrames.add();
    pointTextRef.contents = app.activeDocument.name + "\n" + "YBS";
    pointTextRef.top = 0;
    pointTextRef.left = 0;
    app.activeDocument.textFrames[0].textRange.characterAttributes.textFont=app.textFonts[31];
    function remText()
    // This works for search and replace :))))))
        var active_doc = app.activeDocument; 
        var search_string = /_Template.pdf/gi; // g for global search, remove i to make a case sensitive search 
        var replace_string = ''; 
        var text_frames = active_doc.textFrames; 
        if (text_frames.length > 0) 
            for (var i = 0 ; i < text_frames.length; i++) 
                  var this_text_frame = text_frames[i]; 
                   var new_string = this_text_frame.contents.replace(search_string, replace_string); 
                   if (new_string != this_text_frame.contents) 
                            this_text_frame.contents = new_string; 
    Any ideas about what makes Illustrator crash?
    Note: The application crashes after opening the first file.
    Thanks for helping out!

    Thanks a lot Carlos!
    After deleting line 23: 
    $.setTimeout(function () {sourceDoc.close(SaveOptions.SAVECHANGES)}, 1000);
    the code worked on 499 files in one batch
    Also Turns out Illustrator kept crashing because of a corrupted pdf file.

  • Error 1050 by trying to use load'filename' in matlab script node

    Hi
    I keep getting error 1050 when Labview tries to load a text file through the matlab script node.
    I've all ready checked for it on google and this forum but found nothing. I've also done this: http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53 and tried to use dlmread and more. 
    The thing is that  I need the matlab script node to read a txt file that Labview made from a chart with only 1 array, plot it and export a jpg image. I can't really use the 'export image' or 'get image' function in Labview cause I need the whole plotted chart (these functions only take a snap shot of it when they're run).
    This is my code that I'm using:
     data=load('file') ;
    Vpp=(data(1:2000,1));
    xsize = (1/2000);
    plot(0.0005:0.0005:1,Vpp);
    axis([0 1 -5 5]);
    print('-djpeg', 'graph.jpg');
    The usual load in matlab to load txt files and print to print the jpeg. The code works in matlab but not in labview
    And yeah, I'm using windows 7 and legal versions of matlab r2009b and Labview 2009  
    Solved!
    Go to Solution.
    Attachments:
    matlab.jpg ‏213 KB

    Yes I forgot, this is my error...  It looks like it can't read the file path, but the 'file' path is actually just a path to my c:\user\*\*\*\*.txt 
    Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Error using ==> load
    Unable to read file file: No such file or directory.

  • Mac filenames in Shell Scripts

    I have a radioSHARK which is great but it records programs in aiff file. These can get huge when you're recording hour long radio shows. I have installed a command line version of lame that I want to use to turn them into mp3's. I have a script that works when the file names have no special characters. The radioSHARK automatically puts special characters (specifically spaces) into the file names.
    #!/bin/bash
    cd ~/Music/radioSHARK
    for i in ~/Music/radioSHARK/*.aiff; do
    /usr/local/bin/lame -q 2 $i `basename $i | cut -d. -f1`.mp3
    rm \"$i\"
    done
    When I run the script on a file like vinyl.aiff, it works fine, but when I try it on a name like Vinyl Cafe - Feb 25, 2006.aiff, here is the output I get:
    CND-021774:~/desktop wkonrad$ ./aiff2mp3
    + cd /Users/wkonrad/Music/radioSHARK
    ++ basename /Users/wkonrad/Music/radioSHARK/Vinyl Cafe - Feb 25, 2006.aiff
    ++ cut -d. -f1
    + /usr/local/bin/lame -q 2 /Users/wkonrad/Music/radioSHARK/Vinyl Cafe - Feb 25, 2006.aiff Vinyl Cafe - Feb 25, 2006.mp3
    /usr/local/bin/lame: excess arg Feb
    LAME version 3.96.1 (http://lame.sourceforge.net/)
    usage: /usr/local/bin/lame [options] <infile> [outfile]
    <infile> and/or <outfile> can be "-", which means stdin/stdout.
    Try:
    "/usr/local/bin/lame --help" for general usage information
    or:
    "/usr/local/bin/lame --preset help" for information on suggested predefined settings
    or:
    "/usr/local/bin/lame --longhelp"
    or "/usr/local/bin/lame -?" for a complete options list
    from what I can tell with experimenting, it is trying to take every word between the spaces as a file.
    Is there a way I can cause the for statement to quote the file paths?

    Hi Jun,
    > Isn’t the quoting "$i" just sufficient?
       It certainly is, at least on my machine. I tested it and it worked like a charm. I know that I've had to change the Input Field Separator when looping through the output of a command so I didn't expect that bash would handle globbing correctly but it did. Also, it's nice to be reminded of the ksh-style substitution in parameter substitution. I wasn't thinking about that part of the script but even if I had I would probably thought of something like the more traditional ${i%aiff}mp3. I like yours much better, thanks!
    Gary
    ~~~~
       If a 'train station' is where a train stops,
       what's a 'workstation'?

  • How to automatically add filename as caption

    I would like to automatically create captions based on the file name.  Ultimately I want the slide show to display the file names.

    Hi Martin,
    I am clear with few concerns. You mentioned *"For each group define an access policy that gives an AD account with the "correct" AD groups (on the child form)"* I know about AD account we can define while creating access policy. For AD groups i think we need to define this in pre-populate adapter only. Please let me know if i am wrong.... Also when i have wriiten pre-pop adapter for groups the group name (only single not multiple ) displayed in Lookup when any admin go thru the child form while going thru the resource form. Admin has to take manual action (ADD button) so that provisioning process can attach the user to that AD group/s.
    *"when an OIM user is created the rules will be evaluated and place the OIM user in the right OIM group, this fires the right access policy which then provisions the AD account with the correct groups "* i know about access policy to AD account provisioning. could you please explain about "provision the AD account with AD groups / place the OIM user in right group" on the basis of Access policy.
    As i need to generate a report about AD groups (as per role/ou and manually provisioned by admin) for a particular user and show it under compliant reports this part becomes something imp for me as i cannot think off writing a new adapter that will directly update the group membership of user in AD and update it in OIM Resource AD form in next recon because that will not provide me the detail of groups provided by role as groups added by admin directly in recon will also get reconciled. Please let me know if there is any workaround.

  • How can I use a script to search for a list of filenames and copy them to another directory

    Hi all,
    I'm quite new to using scripts etc and wondered if anyone could help? I've only ever modified preset folder scripts so making one from scratch is a bit new to me, but it would also be great if anyone else has done this before if they could pass on there script and ill modify to suit my needs.
    I will be recieving a tab delimited file containing a list of 150 - 200 clips every day and I need to pull those files onto a hard drive.
    All of the files are housed in one folder on the internal media drive and I would like to be able to have applescript / automator / whatever  either look through the tab file and then move the files in the tab file from the internal media drive to the external transport drive or I copy and paste the filenames into the script and run it and the script moves the files from the internal media drive to the external transport drive.
    Hope someone can help,
    Many Thanks

    There are no other files in the source video root folder nor are there any folders within the subfolders.
    I have tested the script and the response I am getting is this....
    Could this be something to do with the {} on the set filestoMove command?
    In the replies box I get the following....
    tell current application
      read alias "Macintosh HD:Users:Ben:Desktop:Untitled.txt"
      --> "000004_1__4michaeljmcevoy_4iLlBuDjjG0"
    end tell
    tell application "System Events"
      count folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 10
      count item 1 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 1 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> ".DS_Store"
      count item 2 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 2 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000004"
      count item 3 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 3 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000005"
      count item 4 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 4 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000006"
      count item 5 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 5 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000007"
      count item 6 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 6 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000008"
      count item 7 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 7 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000009"
      count item 8 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 8 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000010"
      count item 9 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 9 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000011"
      count item 10 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> 1
      get name of item 1 of item 10 of folder "Macintosh HD:Users:Ben:Desktop:source"
      --> "000012"
    end tell
    tell application "Finder"
      -- 'core'\'clon'{ 'insh':'alis'($000000000152000200010C4D6163696E746F7368204844000000000000000000 000000000000CA40F7FC482B00000006AB3D06736F75726365000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000007FD33CAFABF2E0000000000000000FFFFFFFF000009200000000000000000000000000000 00074465736B746F7000001000080000CA40E9EC0000001100080000CAFABF2E00000001000C0006 AB3D0006AA9B0000BEEC000200284D6163696E746F73682048443A55736572733A0042656E3A0044 657…
      --> {}
    end tell
    Result:

  • Filename to IPTC Title, but without extension. (Currently using DAM script)

    Hello,
    Apologies if this isn't the correct forum to ask this question:
    I am currently using the DAM Filename to Title script with Bridge CS4 - http://www.damuseful.com/pages/PimpMyBridge.html - to get the filename into the IPTC title script. This however puts in the extension into the title field also. So a JPG file named 2000 ends up with 2000.JPG in its Title field. I wish to not have the extension appear in the Title field.
    Is this possible by modifying the DAM script / using any other freely available script.
    In case it helps, this is what the DAM script currently looks like:
    #target bridge
    if ( BridgeTalk.appName = "bridge" )
    //This script copies selected thumbnails' filenames to the title field
    //Also shows how to add menu items
    //The AdobeLibrary scripts must be loaded
    //This script was created by John Beardsworth www.beardsworth.co.uk/ and modified by Peter Krogh www.DAMuseful.com
    //This script may be freely distributed and modified
    // Let's create our menu
        var menu = MenuElement.create( "command", "Write Filename to IPTC Title Field", "at the end of Tools");
        menu.onSelect = function(m)
    var getFolderChildren = true ;
    var filesOnly = true ;
    var thumbs = getBridgeThumbnails ( TYPES.PHOTOSHOP_OPENABLE, getFolderChildren, filesOnly) ;
    for ( var i = 0; i < thumbs.length; i++ )
    { thumb = thumbs[i];
       md = thumb.synchronousMetadata;
       md.namespace ="http://ns.adobe.com/photoshop/1.0/";
       md.Title = thumb.name;
       Window.alert ("Done " + i + " records");
    There are also 3 other Adobe Library scripts that come with the download.
    I know absolutely nothing about scripting, so baby-steps would be appreciated.
    Many thanks.

    Change:
    md.Title = thumb.name;
    To:
    md.Title = decodeURI(thumb.name).replace(/\.[^\.]+$/, '');

  • Export using caption field as filename

    Is it possible to use custom data in the caption field for filename on export with Aperture 3.3?
    e.g      filename - dsc_445
             caption field - jason
    eported filename = jason.jpg
    Thanks in Advance for your reply
    J.

    Not possible in Aperture as it is.
    It might be possible to do this using an Applescript to access the caption information and then do the export but I'm not sure. I'd have to check out the Aperture/Applescript interface to be sure.
    regards

  • Can the filename be printed on exported images?

    I'm using LR 3.5, and am wondering if I can have the filenames show on the images when I export them.  If so, how do I make that happen?  I am already watermarking a copyright script, which I suppose I could change to include the image name, but that would be pretty tiresome to do.  I assume there is an easy way to do this that I just haven't found.  Thanks!

    There is one native sort of alternative: You do not literally export the images, but print them to jpg in the Print module.
    Select "Single image / Contact Sheet", set a watermark, maybe also an identity plate, plus tick the Photo Info and choose "Filename" (or "Caption" or "Title" instead for a slightly different use case).
    Don't get confused: you need to choose a file name for the print-export, but the filename printed on each image will be the original one.
    Cornelia

  • Creating list of folders from filenames with files organized in subfolders within

    Hi all. This is my first post in the Apple Support Community and I really hope that someone can help me as I'm using apple script for the first time.
    I have a list of hundreds of items that are each .jpg, .cr2, or .mov. Certain filenames have multiple extensions, ex: Q95A7170.CR2 & Q95A7170.jpg.
    I'm looking for an applescript or automator action that will allow me to create a folder out of each filename with 5 subfolders in it
    I need the subfolders to be called:
    AUDIO
    COLOR
    METADATA
    PICTURE
    PROXY
    In this instance I need all the .mov, .cr2, and .jpgs to be routed to the PICTURE folder. In later instances I'll need to route .mxf to PICTURE AND .xml .sif  & .thm to METADATA.
    So for example I have a list of that looks like this
    and I want a script that will make it look like this (i did all of this manually: creating the folders, renaming them, and putting the specific files into the picture folder)
    (not nearly a fraction of the list -- there are hundreds and hundreds of files)
    I've been researching applescripts for hours but the only script that i could make work and was very useful was this one to create the folders out of the names of the files:
    tell application "Finder"
              set selected to selection
              set current_folder to item 1 of selected
              set mlist to every file of current_folder
              repeat with this_file in mlist
                        set cur_ext to name extension of this_file
                        set new_name to text 1 thru -((length of cur_ext) + 2) of (name of this_file as text)
                        set new_folder to make new folder with properties {name:new_name} at current_folder
      move this_file to new_folder
              end repeat
    end tell
    Even with this script I had to manually copy all of the duplicate file named .jpgs out of the folder before it would properly run.
    Also I've found these scripts but I'm not sure what information to change. Like I said, I don't know much about code at all and I'm finding more research about it is just digging me deeper in a hole that I'm not entirely ready for.
    Here are the other two scripts that CLAIM they can do what I'm looking for, but I haven't gotten them to work.
    1.
    set pathToFolderOfTTUFiles to (path to the desktop as text) & "TTU:"
    tell application "Finder"
        set theFiles to every item of folder pathToFolderOfTTUFiles whose name extension is not "csv" and kind is not "Folder"
        repeat with theFile in theFiles
            set lengthOfExtension to (length of (theFile's name extension as text)) + 1
            set fileNameWithoutExtension to text 1 through -(lengthOfExtension + 1) of (theFile's name as text)
            set theFolder to make new folder at folder pathToFolderOfTTUFiles with properties {name:fileNameWithoutExtension}
            set theContentFolder to make new folder at theFolder with properties {name:"content"}
            make new folder at theContentFolder with properties {name:"archive"}
            set theContentDisplayFolder to make new folder at theContentFolder with properties {name:"display"}
            set theMetadataFolder to make new folder at theFolder with properties {name:"metadata"}
            make new folder at theMetadataFolder with properties {name:"archive"}
            set theMetadataDisplayFolder to make new folder at theMetadataFolder with properties {name:"display"}
            move theFile to theContentDisplayFolder
            set pathToCSV to pathToFolderOfTTUFiles & fileNameWithoutExtension & ".csv"
            if exists pathToCSV then move pathToCSV to theMetadataDisplayFolder
        end repeat
    end tell
    2.
    set myFolder to "FOLDERPATH"
    tell application "Finder" to set myFiles to folder myFolder's files as alias list
    repeat with aFile in myFiles
        tell application "System Events" to set {fileName, fileExt} to {name, name extension} of aFile
        set baseName to text 1 thru ((get offset of "." & fileExt in fileName) - 1) of fileName
        do shell script "mkdir -p " & (quoted form of (POSIX path of myFolder)) & "/" & baseName & "/{\"content\",\"metadata\"}/{\"display\",\"archive\"}"
        tell application "System Events"
            if fileExt is "pdf" then move aFile to (myFolder & ":" & baseName & ":content:display" as text)
            if fileExt is "csv" then move aFile to (myFolder & ":" & baseName & ":metadata:display" as text)
        end tell
    end repeat
    (the .pdf, .csv extensions are examples from the person who posted that discussion.)
    I tried using both of these codes but to no avail.
    Overall, this process is incredibly time-consuming and this is the first time I am using apple script so I know almost nothing about code.
    Also I don't know if this changes anything, but all of these files are on an external and I'm trying to save them back on this external.
    PLEASE HELP! I am a night assistant editor doing very tedious work at 3:00 AM or later and anything that would expedite this process would be so unbelievably appreciated. Please, someone who's more experience with code and who's smarter than I am on this topic, help me! I know there must be a way to automate this process!
    Please and so many thank yous! Really, this code would save me 40+ hours of eye-tiring work.
    Shelby

    This is how you'd do it in AppleScript.  I assume you can see how to expand it to different file extensions...
    set workFolder to "/path/to/folder"
    tell application "System Events"
      -- get files to work on
              set filesToProcess to files of folder workFolder whose visible is true
              repeat with thisFile in filesToProcess
                        set {fileName, fileExt} to {name, name extension} of thisFile
      -- get name of file without extension
                        set rootName to text 1 thru -((length of fileExt) + 2) of fileName
      -- make sure a correctly named folder exists
                        set targetFolder to my checkForFolder({parentFolder:workFolder, folderName:rootName})
      -- sort files into subFolders, making sure subfolders exist
                        if fileExt is "jpg" or fileExt is "cr2" or fileExt is "mov" then
                                  set targetSubfolder to my checkForFolder({parentFolder:targetFolder, folderName:"PICTURE"})
                                  move thisFile to targetSubfolder
                        else if fileExt is "xml" or fileExt is "sif" or fileExt is "thm" then
                                  set targetSubfolder to my checkForFolder({parentFolder:targetFolder, folderName:"METADATA"})
                                  move thisFile to targetSubfolder
                        else if fileExt is "mxf" then
                                  set targetSubfolder to my checkForFolder({parentFolder:targetFolder, folderName:"PICTURE"})
                                  move thisFile to targetSubfolder
                        else
      -- skip unknown file extensions
                        end if
              end repeat
    end tell
    to checkForFolder({parentFolder:fParent, folderName:fName})
      -- find or create a folder
              tell application "System Events"
                        if not (exists folder fName of folder fParent) then
                                  set output to POSIX path of (make new folder at end of folder fParent with properties {name:fName})
                        else
                                  set output to (POSIX path of (folder fName of folder fParent))
                        end if
              end tell
      -- returns a POSIX path
              return output
    end checkForFolder

Maybe you are looking for