Shell script to determine file width, height, resolution cs5 js

I’ve been using a Script by Michael L Hale (that utilizes »xmp.getProperty« and Bridge’s »core.quickMetadata«) to determine files’s dimension and resolution without having to open or place them.
Unfortunately it fails with some files (non-Photoshop generated bitmaps, it seems).
(Pdfs I treat differently altogether to avoid the trouble of determining pdf-page counts and potential problems with pdfs containing differently sized pages.)
Do any of you know if and how one can access files’ width, height, resolution with »app.system« in CS5?
I may have come across it before, but can’t locate such a thread currently.
Thanks for any input.

These are 2 options that you could use if you wanted to dump all the info to text file then parse in JS. You could see if either of these contain the data that you are after?
#target bridge
var foo = File('~/Desktop/SomeFile.tif');
getAllXMLSIPS(foo);
//getMetaDataMDLS(foo)
function getAllXMLSIPS(f) {
     if (f instanceof File && f.exists) {
          var shellString = "sips --getProperty allxml ";
          shellString += f.fsName;
          shellString += ' > ~/Documents/StdOut.txt';
          app.system(shellString);
function getMetaDataMDLS(f) {
     if (f instanceof File && f.exists) {
          var shellString = "/usr/bin/mdls ";
          shellString += f.fsName;
          shellString += ' > ~/Documents/StdOut.txt';
          app.system(shellString);

Similar Messages

  • Crop Aspect Ratio, width, height, resolution locks up

    I am running PSE6 on an XP PC platform.
    This anomaly happens about 75% of the time.
    After processing a batch of raw images in Camera Raw, highlighting them and clicking on Open Image to open the converted images in PSE, I sometimes find I cannot open the Crop Aspect Ratio selection drop-down box.  Nor can I type in changes to Width, Height, and Resolution fields--I can, however change the values by using the sliders that appear when I mouseover the Width, Height or Resolution titles, but even that's limited--whatever is to the right of the decimal point remains unchanged.
    I've also experienced this Crop "lock-out" when just opening JPEG/TIFF/PSD images directly from the image file folder.
    The only way I have found to clear this anomaly has been to close and reopen PSE.  Today, for the first time, that didn't fix the problem.  It came up with Crop locked up.
    Has anyone else run into this?  If so, what, if any, solution is there?
    Thanks,
    dale

    First try clicking the little arrow at the far left of the options bar and choosing reset tool. If that doesn't do it, quit the editor, then restart it while holding down ctrl+alt+shift. Keep holding the keys till you see a window asking if you want to delete the settings file. You do.

  • Unix shell script to batch file for windows

    Hello all,
    Iam writing a program in java in unix environment and iam executing using shell scripts in unix this program is for client-server environment
    which look like this:
    For server:
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    #set var for filename config file
    export JAL_CONF_FILE=/user/vpp/jal/conf/JALapp.conf
    java -DJAL_CONF_FILE=$JAL_CONF_FILE jalsvr/JALTCPServer 7776for client side it is
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    echo $CLASSPATH
    java jalcl/JALTCPClient msoc05:7776my question is know i want to execute them in windows by creating batch files runsvr.bat, runcl.batbut how
    i gave PATH by giving JRE path but what is the replacement of export because iam having all class files
    in /jalcl for clients and /jalsvr for server but want to create this batch file in separate /bin folder how to do.please help me

    Thank you for reply ,
    And sorry by mistake question repeated twice,
    but when iam executing those batch files it is throwing some exceptions,
    in that file you did not mention to set the JRE path whether it is not necessary and also there msoc05 is the machine name of unix system that need to kept or need to be changed with window IP address .please reply.
    thanks in advance.

  • Unix Shell Script to check file Format

    Hello
    I am New to shell scripting.Please help me to write a script for the below condition.Any help is highly appreciated.
    I will get a text file every month like the one below
    Sample file
    Payslip.txt
    ========
    EMPID EMAIL PCTAG#
    4946:[email protected]:151207
    4978:[email protected]:154434
    5091:[email protected]:160784
    5208:[email protected]:153601
    5211:[email protected]:158963
    5218:[email protected]:156967
    5247:[email protected]:153760
    5250:[email protected]:160078
    5276:[email protected]:154693
    I should check for the below conditions in the above file
    Conditions:
    =======
    1.File should be seperated by colon(;)
    2.EMPID should not be null
    3.Email address and pc tag# should be null if it is missing
    4.No empty record should be there
    All the above four conditions should be checked
    If any one of four conditions are not met then the file is invalid and it should exit with status saying that file is invalid.
    If all the four conditions are met it should say that the file is valid
    Any help is highly appreciated.It is urgent.
    Thanks in advance
    Manoj

    Try this :
    error()
    {       echo -n "Line "$NR "  "$LINE "  "       >>$STATUS
            echo $1                                 >>$STATUS
    NR=0
    STATUS=/tmp/status.txt
    rm -f $STATUS
    cat Payslip.txt | while read LINE
    do
            NR=`expr $NR + 1`
            ### Check colons ###########
            if [ ! "`echo $LINE | grep :`" ]; then
                    error "No colon"
                    continue
            fi
            EMPID=`echo $LINE | awk -F: '{print $1}'`
            EMAIL=`echo $LINE | awk -F: '{print $2}'`
            PCTAG=`echo $LINE | awk -F: '{print $3}'`
            ### Check null line ###########
            if [ ! "$EMPID" -a ! "$EMAIL" -a ! "$PCTAG" ]; then
                    error "Null line"
                    continue
            fi
            ### Check null EMPID ###########
            if [ ! "$EMPID" ]; then
                    error "No Empid"
                    continue
            fi
    done
    echo
    if [ -f $STATUS ]; then
            cat $STATUS
            echo
            echo "File is Invalid"
    else
            echo "File is Valid"
    fi
    echo

  • Automator: shell script to change file permissions

    Hey guys,
    Just created a workflow to copy some files from one location to another.
    Second thing I want to do is run a shell-script to set some file permissions recursively, some for the folders, the other for the files.
    I figured I could do the following:
    cd /IntoAFolder
    find . -type d -exec chmod 770 {} \;
    Unfortunately, this seems to be needed to be done as a sudo'er and thus requires the user's password.
    So the question is, how do I get that password and hand it to the shell script or is there another way of doing this?

    What I want to do is recursively chmod the subfolders and files of a "root"-folder.
    The way I know to do so is:
    cd /root-folder
    find . -type d -exec chmod 755 {} \;
    That will chmod all subfolders from the root-folder to 755.
    Next i want
    find . -type f -exec chmod 644 {} \;
    That will chmod all subfiles fromn the root-folder to 644
    Unfortunately, find gives me a permission denied when I run this command from the command-line. When I just manualy chmod everything that works fine but is a bit to much work when it comes down to a tree of 5 subfolders and 120 files.
    Waht basically hapens:
    The user selects a bunch of folders.
    Then they are copied to /Applications/RCT3.localised/Data/Styles/Themed
    and then I need to chmod them just to be sure, as sometimes stuff break along the way if you don't

  • Writing a shell script to move files

    Hello,
    I'm trying to write a shell script that will move files from one directory to another at a time specified by me. I've got a similar script attached to an Automator action, which is triggered nightly by iCal.
    Of course, this one simply deletes files that are older than a day in a couple of locations. I'd like to have another that MOVES files and folders from one location to another. So far, I've come up with this:
    find /Volumes/Location/01/* -type d -or -type f -mtime +7 -exec mv -f /Volumes/Location/01/* /Volumes/Location/02/ ;
    Which just about works, but it actually seems to be moving all the files that are LESS than a week old. Any and all suggestions are appreciated, as I'm a total n00b here.

    find /Volumes/Location/01/*
    -type d -or -type f -mtime +7
    -exec mv -f /Volumes/Location/01/* /Volumes/Location/02/ ;
    Which just about works, but it actually seems to be moving all the files
    that are LESS than a week old. Any and all suggestions are appreciated,
    as I'm a total n00b here.
    your -exec is not selecting the files or directories found by the 'find' command.
    It is moving everything in /Volumes/Location/01/*
    Looking at "man find", I think you want your -exec to be
    -exec /Volumes/Location/01/{} /Volumes/Location/02/ ;
    As red_menace has pointed out, you have to change your -type options
    so that you select directories or files.
    You may also want to include -prune so that you do not decend
    into subdirectories.
    While the following is untested, I might write the command like this:
    find /Volumes/Location/01/*
    -prune -mtime +7
    ( -type d -or -type f )
    -exec mv -f /Volumes/Location/01/{} /Volumes/Location/02/ ;

  • Shell Scripting to replace file type

    Hey all,
    I'm having some trouble with a shell script. I'm trying to run a script that will look through all the folders in a given directory for a certain type of file (.data) and then will run a getfileinfo -t on the .data file and, if the type is "" (empty), replace it with a given string.
    So far I can get the command to look through directories and I can get it to echo the getfileinfo -t, but I can't put the result of the command into a variable so I can check to see if it meets the "" condition. Any help would be greatly appreciated.
    Also, I am doing this in CSH, but I am no opposed to doing it another way, just so long as it works.

    Hi JohnSka7,
       I really like Niel's solution but it can be done in a script without AppleScript if you have Apple's Developer Tools installed. I don't do csh so I'll give it to you in bash and leave it as an exercise to translate:
    #!/bin/bash
    oldIFS=$IFS
    IFS=$'\n'
    for FILE in $( find "$1" -type f -name "*.data" ); do
       IFS=$oldIFS
       if [ \"\" = $( /Developer/Tools/GetFileInfo -t "$FILE" ) ]; then
          /Developer/Tools/SetFile -t "XXXX" "$FILE"
       fi
    done
    This temporarily sets the Input Field Separator, IFS, to a newline so that the snippet can handle filenames containing spaces. It assumes that the first argument to the script is the directory to be searched. Of course you should change "XXXX" to the type code you want and you can arrange for that to be specified in another argument. If you copy-and-paste this into a script, be sure to replace the non-breaking spaces I've used for indention with real spaces.
    Gary
    ~~~~
       Maslow's Maxim:
          If the only tool you have is a hammer, you treat
          everything like a nail.

  • Shell Script to compare files

    Hi All,
    Below is the sample script used to compare two files, this can be enhanced further.
    DATE=`date +%Y%m%d`
    TIME=`date +%H%M%S`
    count = 0
    echo "Provide the TOP (e.g. XXFIN)" #| ${TEE}
    read TOP
    echo "Provide the inputs from these: FORMS or REPORTS or JAVA or XML or ADMIN_SQL or TEMPLATES"
    read TYPE
    FILE=${TOP}_${TYPE}_Compare_File_Results_${DATE}${TIME}.log
    TEE="tee -a ${FILE}"
    echo "##########################################################################################################################" | ${TEE}
    echo "File Comparison Type if Binary provide 'B' or 'O':" | ${TEE}
    read file_type
    echo file_type
    echo "Provide Production file path:" | ${TEE}
    read prod_path
    echo "Provide Fix file path:" | ${TEE}
    read fix_path
    echo "You have provided Production file path as :$prod_path" | ${TEE}
    echo "You have provided Fix file path as :$fix_path" | ${TEE}
    echo "Compare Results will be shown in file:" | ${TEE}
    echo "##########################################################################################################################" | ${TEE}
    for release in `ls -R $prod_path`; do #`ls /app/ebs/atgsidev01/gsidev01cust/xxcomn/java/Test/1/`; do
    if cmp -s "$prod_path/$release" "$fix_path/$release"
    then
    echo "TEST............="cmp -s "$prod_path/$release" "$fix_path/$fix" | ${TEE}
    fi
         if [ -f $fix_path/$release  ]
         then
              echo #"File Exists...." >> Compare_File_Results.txt
         if [ 'B' -eq "$file_type" ];
         then
         if diff -q "$prod_path/$release" "$fix_path/$release" ;
         then
              echo #"The files match"$release
         else
              echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${TEE}
    echo "File Name:"$release | ${TEE}
              echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${TEE}
         count=`expr $count + 1`
              echo "The files are different: "$release | ${TEE}
              diff -w "$prod_path/$release" "$fix_path/$release" | ${TEE};
         fi # End of if diff -q
         else
         if cmp -s "$prod_path/$release" "$fix_path/$release"
         then
              echo #"The files match"$release
         else
         echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${TEE}
    echo "File Name:"$release | ${TEE}
              echo "==========================================================================================================================" | ${TEE}
         count=`expr $count + 1`
              echo "The files are different: "$release | ${TEE}
              diff -w "$prod_path/$release" "$fix_path/$release" | ${TEE};
              echo "==========================================================================================================================" | ${TEE}
              echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${TEE}
         fi #End of if cmp -s
         fi #if [ 'B' -eq      
         fi # if [ -f
    done
    echo "##########################################################################################################################" | ${TEE}
    echo "Count of files=$count" | ${TEE}
    echo "##########################################################################################################################" | ${TEE}

    Thanks Suraj!
    ;) AppsMasti ;)
    Sharing is Caring

  • Shell script, automator and file permissions

    We have an environment where, that when a user creates a folder on a network vol, it is owned by them and no one else has access to it. They then place a folder structure from there local HD into that folder they just created on the server. You would think a simple get info window with the user changing the permissions to include all would actually change all the file permissions in the enclosed folder, but it doesn't. I have a simple script written in automator using /bin/bash that is supposed to change the permissions in every folder and file to rw for all (user, group and everyone). It doesn't seem to be working correctly all the time for a few users.
    for f in "$@"
    do
    chmod -R 777 "$f"
    done
    I have tried this as well
    for f in "$@"
    do
    chmod -R a+rw "$f"
    done
    But that should be pretty much the same thing.
    Something i have noticed is the users with the most problem are running 10.4.11, while the script was written in 10.5. Also the users that are having the problem dont seem to have the same get info window as the rest of the 10.4.11 users, it very closely resembles 10.5, with some minor differences. It seems they are missing the groups or something. This might be more or less than an issue than I realize.
    http://picasaweb.google.com/tiemmothi/UserPermissions?feat=directlink
    the 10.4 window in question is "the offender" and
    "Mine" is 10.5

    *Access Control List* entries are in addition to the regular POSIX permissions. They are not required, but add finer levels of access control. Setting the regular permissions to read/write for everyone should work unless there are ACL entries which allow additional access - you can see ACL entries and extended attributes with/bin/ls -le@d /path/to/some/folder
    An inherited ACL entry to allow everyone read/write access would look something likechmod -R +a "everyone allow list,addfile,search,delete,add_subdirectory,delete_child,readattr,writeattr,chown,file_inherit,directoryinherit" /path/to/some/folderA users */Public/Drop Box* folder has similar entries.

  • SQLScript or Shell Script to Determine if Notification Mailer has gone down

    Does anyone have a SQLScript or UNIX command which determines if the Workflow Notification mailers have unexpectedly died?

    It looks like the GSM Service Components can be running/stopped independent of the concurrent manager queues that normally start/stop them from Administer Managers or start_all/stop_all in OAM Generic Services. You could simply monitor fnd_svc_components, or use any of the SQLs below. If you search Metalink for FND_SVC_COMPONENTS, you will find a few articles that describe monitoring techniques.
    SELECT component_name, component_status
    FROM fnd_svc_components
    WHERE component_type = 'WF_MAILER';
    SQL> SELECT q.concurrent_queue_name||':'||d.user_concurrent_queue_name||':'||
    DECODE(p.process_status_code,'A','$UP', '$DOWN')||':'||
    DECODE(p.os_process_id,NULL,'NOPROCESS',p.os_process_id||':'||
    DECODE(q.concurrent_queue_name,'WFMLRSVC','GSM Status: '||c.component_status))
    FROM fnd_concurrent_queues q,
    fnd_concurrent_queues_tl d,
    fnd_concurrent_processes p,
    fnd_svc_components c
    WHERE q.concurrent_queue_name LIKE 'WF%'
    AND q.enabled_flag = 'Y'
    AND c.component_id = 10006
    AND q.concurrent_queue_id=d.concurrent_queue_id
    AND q.concurrent_queue_id = p.concurrent_queue_id(+)
    AND p.process_status_code(+) = 'A'
    Q.CONCURRENT_QUEUE_NAME||':'||D.USER_CONCURRENT_QUEUE_NAME||':'||DECODE(P.PROCES
    WFWSSVC:Workflow Document Web Services Service:$UP:16418:
    WFALSNRSVC:Workflow Agent Listener Service:$UP:16422:
    WFMLRSVC:Workflow Mailer Service:$UP:16419:GSM Status: DEACTIVATED_USER
    SQL> /
    Q.CONCURRENT_QUEUE_NAME||':'||D.USER_CONCURRENT_QUEUE_NAME||':'||DECODE(P.PROCES
    WFWSSVC:Workflow Document Web Services Service:$UP:16418:
    WFALSNRSVC:Workflow Agent Listener Service:$UP:16422:
    WFMLRSVC:Workflow Mailer Service:$UP:16419:GSM Status: RUNNING
    select fcq.USER_CONCURRENT_QUEUE_NAME Container_Name, DECODE(fcp.OS_PROCESS_ID,NULL,'NotRunning',fcp.OS_PROCESS_ID) PROCID,
    fcq.MAX_PROCESSES TARGET,
    fcq.RUNNING_PROCESSES ACTUAL,
    fcq.ENABLED_FLAG ENABLED,
    fsc.COMPONENT_NAME,
    fsc.STARTUP_MODE,
    fsc.COMPONENT_STATUS
    from APPS.FND_CONCURRENT_QUEUES_VL fcq, APPS.FND_CP_SERVICES fcs,
    APPS.FND_CONCURRENT_PROCESSES fcp, fnd_svc_components fsc
    where fcq.MANAGER_TYPE = fcs.SERVICE_ID
    and fcs.SERVICE_HANDLE = 'FNDCPGSC'
    and fsc.concurrent_queue_id = fcq.concurrent_queue_id(+)
    and fcq.concurrent_queue_id = fcp.concurrent_queue_id(+)
    and fcq.application_id = fcp.queue_application_id(+)
    and fcp.process_status_code(+) = 'A'
    order by fcp.OS_PROCESS_ID, fsc.STARTUP_MODE;
    How to Check Whether Notification Mailer is Working or Not
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=415516.1
    How To Receive An Alert When The Workflow Notification Mailer Crashes Post ATG RUP4
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=423116.1
    Outbound Workflow Email Notification is Not Received
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=370327.1

  • Script to determine display resolution

    Does anyone know how to use Applescript to determine what the monitor's resolution is set at? Example: 1024 X 768. I want to center things on the screen independent of what the resolution is set to.

    One way is to use the system_profiler utility:
    do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution'" -- get info
    tell the result to set {DisplayWidth, DisplayHeight} to {word 2, word 4} -- get resolution
    log {DisplayWidth, DisplayHeight}

  • Passing shell script variable to sql file by reference (bind variable)

    Hi All,
    I need to import around 50 files every 15 minutes into my target table.
    I am using shell script and call procedure to do transform.
    I used crontab to do this automate task.
    Here is my shell script and sql file:
    shell script:
    #!/bin/sh
    export ORACLE_HOME=/u01/app/oracle/product/9.2.0.4.0
    export PATH=$ORACLE_HOME/bin
    find /path_rawfile/rawfile -iname raw\*.in > myfile.lst
    nfile=1
    while [ true ]
    do
    read iFile #read a line
    if [ $? -ne 0 ] #Break if EOF
    then
    break
    fi
    #$PATH/sqlplus -s /NOLOG @load_raw.sql $iFile
    #/bin/mv -f $iFile /path_rawfile/rawfile/done/
    done < myfile.lst
    sql file:
    connect test/test@evn1
    set serveroutput on
    variable filename varchar2(50)
    begin
    :filename := '&1';
    exec my_tranform(:filename);
    dbms_output.put_line(:filename);
    end;
    exit;
    Even I used bind variable pass to procedure my_transform...
    But when i query in sys.v_$sqlarea, the :filename:='&1' still hard parse to sqlarea.
    One filename one statement and keep increasing ..
    Could everyone help me to change it to bind varialbe(soft parse)?
    I would like to incresae my database performance.
    Thanks in advance.
    Cheer
    Message was edited by:
    lux

    It is the procedure.
    It's my fault.
    Here is my SQL file again:
    conn test/test@evn1
    variable filename varchar2(500);
    exec :filename:='&1';
    exec my_transform(:filename);
    exit;
    I call this sql file from shell script and call in loop due to i need to load all file one time.
    Once i use <<EOF it raise error that's why when I deleted it.
    Anyway, what I need to do here is to use bind variable (soft parse).
    Since I need to load around 50 files every 15 minutes.
    exec :filename:='&1'; this statmet have found hard parse in v_$sqlarea.
    I would like to change this to bind varialbe.
    Thanks again for your help.

  • Displaying an alert (Applescript or otherwise) from shell script?

    I have a point in a shell script where I'd like to put up an alert dialogue on a particular error condition. The script runs in the background and doesn't have a terminal window. I tried writing a little applescript that uses the applescript alert command and call it using osascript from my shell script, but it doesn't work. If I enter "osascript ~/myscript.scpt" in a terminal window, I get the error message "/Users/Ted/myscript.scpt: execution error:No user interaction allowed. (-1713)" (If I run myscript.scpt from the script editor it does what I want it to do.) Any ideas? I suppose I could have my shell script create a file in some folder and have my applescript be triggered as a folder action, but that seems pretty roundabout!

    Thanks -- I apologize for not doing a more thorough search! Yes, that comes very close to addressing my need, but I have run into one difficulty. If I run my shell script from the terminal (pasting it in) everything works fine. If I run it as a packaged app (with Platypus) everything works like it's supposed to, except that the alert applescript (it's just a one line script) briefly flashes the alert dialogue when it's supposed to and then dies, rather than waiting 10 seconds or until I click OK. I'll have to experiment and see if I can tell what's going on.

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • Modify shell script to work with other folders

    i am trying to modify a shell script that sorts files in a course folder into sub folders by month. I have a shell script that works, but when i try to modify it for another course folder it quits working. can someone let me know what i am doing wrong?
    the working shell script:
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do if [ ! -d \"$f\" ]; then
    x=\"${f%%.*}\"
    i=$((${#x}-3))
    if [ -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
    mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
    fi
    fi
    done"
    the nonworking modified script:
    do shell script "
    for f in \"$HOME/Desktop/DOEP Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DOEP monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DOEP monthly/${f:$i:3}\"
            fi
        fi
    done"

    ok here is the applescript that works.
    property total_student : 1
    tell application "Finder"
      set master_path to alias "Users:macbook:Desktop:DWI Annual Report:Annual Report.xlsx"
      set filesWithDWI to get every file of folder ((path to desktop folder) & "DWI Annual Report" as string) whose name contains "DWI"
      repeat with f in filesWithDWI
      my transfer_data(f, master_path)
      end repeat
    end tell
    on transfer_data(child_path, master_path)
      tell application "Microsoft Excel"
      set child_book to (open workbook workbook file name (child_path as string))
      set child_doc to worksheet 1 of child_book
      set master to worksheet "sheet 1" of (open workbook workbook file name (master_path as string))
      set num to 15 --All lists start at index 12 or later, I'm putting 10 to be safe
      set students to {}
      tell child_doc --grab values from child document
      repeat until (value of cell (("A" & num) as string)) is 1
      set num to num + 1
      end repeat
      repeat until (value of cell (("B" & num) as string)) is ""
      set end of students to {namevalue of cell (("B" & num) as string)), driver_idvalue of cell (("C" & num) as string)), DOBvalue of cell (("D" & num) as string)), Ref_Recvalue of cell (("I" & num) as string)), pre_testvalue of cell (("J" & num) as string)), post_testvalue of cell (("K" & num) as string)), cert_idvalue of cell (("L" & num) as string))}
    set num to num + 1
      end repeat
      set startdate to range "C7"
      set classlocation to range "C11"
      set instructor to range "H7"
      end tell
      tell master
      set num to 7
      log (value of cell (("B" & num) as string))
      repeat until (value of cell (("B" & num) as string)) is ""
      set num to num + 1
      end repeat
      repeat with student in students
      set value of cell (("A" & num) as string) to total_student
      set value of cell (("B" & num) as string) to name of student
      set value of cell (("C" & num) as string) to driver_id of student
      set value of cell (("D" & num) as string) to DOB of student
      set value of cell (("H" & num) as string) to pre_test of student
      set value of cell (("I" & num) as string) to post_test of student
      set value of cell (("J" & num) as string) to cert_id of student
      set value of cell (("f" & num) as string) to startdate
      set value of cell (("E" & num) as string) to classlocation
      set value of cell (("G" & num) as string) to instructor
      set value of cell (("K" & num) as string) to Ref_Rec of student
      set num to num + 1
      set total_student to total_student + 1
      end repeat
      end tell
      save child_book
      close child_book
      save active workbook in master_path
      close active workbook
      end tell
    end transfer_data
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
            fi
        fi
    done"
    It takes the class rosters and copies the information from the class roster to the annual report and then moves the file to the monthly  folder and files it in the appropriate months folder based on the last three letters of the file name.

Maybe you are looking for

  • Can't re-open a large file in Numbers

    I created a large spreadsheet in Numbers. It has a lot of spreadsheets and graphs. I was saving every change I made. When I replacing one of the graphs, it froze while I was trying to rotate it. I had to force quit. I wasn't concerned because I had s

  • How can I get IChat contacts on my IMessage?

    Hi, so I just got my new mac and I was very excited to start Ichatting. However, Ichat has been replaced by Imessage. I have a few questions regarding this. Is there a way for me to unistall imessage and get Ichat instead? If not, then how can I add

  • Help - formula for date automatically displayed as per given frequency period

    Details of report received date and delayed no of days  in submission S/No Details of Report Frequency Date as per Frequency (Target Date) Received up to as on lapse of days Fin per Day Fine Amount 24.07.2014 (Rs.) 1 Cash book Daily 24.07.2014 30.06.

  • Dictation not working. Please help.

    Just bought an iMac. Updated to mountain lion yesterday. Wanted to try Dictation, but doesn't seem to work. Have tried rebooting, changing language preferences, region preferences etc etc. but still not working. Three blue dots appeared and then disa

  • UI locked in unusable state after failed call

    This app is ghastly. I don't think I have ever encountered a more unintuitive, buggy release of a product.  No one should use it.  Hard to navigate through and to its various functions, and it has not, after failing to reach a number in Germany that