Repeat loops

Within a repeat loop, I get creation dates of sequential files. I can get the creation date of the first file but then when it repeats it wont get the creation date of the next file. When i run it again i can get the creation date of the first two, but not the third. The next time i run it i can get the creation date of the first three but not the fourth, and so on.
Does anyone know why this is happening and what can i do to get the creation dates the first time?
Thank you

Hello John,
The part where I am having a problem is here.
I perform some script that allows me to find these files and which files i need to use and then there is this..
count folder folderList
set folderCount to result
set x to 0
repeat until x = folderCount
set x to x + 1
set filePath to folderList & ":" & x & ".jpg"
get creation date of file filePath
set creationDate to result
get date string of creationDate
set dateString to result
get time string of creationDate
set timeString to result
theres a lot more between this and the end of the repeat.
It won't allow me to get the creation date out of the file filePath. so there for I cannot perform the rest of this. I thought it was a problem with the computer because what I have should run. It does not run the first time, it says that the creation date is missing value in the event log. Then I run it again and it gets the first files date, but not the second. then the next time it gets the first two and not the third and so on..
thanks for all the help,
David

Similar Messages

  • Real Instruments play beyond end of repeated loop

    I've tried every google-fu trick I could think of to see if anyone else has had this problem.
    I record a real instrument (say an electric guitar riff). I drag/repeat/loop it 3 or 4 times. It plays properly.
    Then at some point I select it, and move it left or right.
    The part starts at the right time, but will repeat an extra time beyond the visible onscreen loop. Once this glitch occurs, neither resaving, shrinking/re-repeating, moving it around and then back to where I want it make the track end when it's supposed to.
    The only way I've found around it, is to end the repeat early and let the erroneous repeat play out, or just end the repeat entirely, and use cut'n'paste instead.
    This happens to me *all the time*... anyone else seen this or have a resolution?

    Thanks for the suggestions. I can't remember deleting any tracks... however, how would i check for "hidden" tracks?
    The funny thing is i can hear the effect returns for the real instrument tracks...tracks that are heavily reverbed i can hear a faint echo of the track. and like i mentioned the drum loop and software piano still play fine.
    And, I also see monitor activity in the real instrument tracks when i play the song. Everything looks normal, but of course, the sound isn't there.
    Thanks again for your help!
    Message was edited by: Ike the Longshoreman
    P.S. I just tried Unsolo all tracks and Unmute all tracks... still the same problem.

  • Repeat Loop times out and I don't want it to

    Maybe there is a better way to do this but I want an action to take place whenever the modification date of a certain file changes. This is what I use but it errors because of a timeout after about 10 mins if the mod date doesn't change. I need this to be checking all the time.
    on idle
    tell application "Finder"
    set UpdatedOLD to modification date of file aFile
    set UpdatedNEW to modification date of file aFile
    end tell
    repeat while UpdatedOLD = UpdatedNEW
    tell application "Finder"
    set UpdatedNEW to modification date of file aFile
    end tell
    end repeat
    end idle
    How can I get this to work?

    Hello
    I think you have stepped on a land mine set by OSX 10.6.
    There's a fatal bug in Apple Event Manager in 10.6 such that one event in every 65535 events will be lost and never be replied, which will result in Apple Event timeout error on sender. This bug has been reported shortly after the 10.6 release and has not yet been fixed as of 10.6.2.
    In your current script, you're continuously sending event to Finder and sooner on later send an event with the specific event id that is doomed to be lost. Judging from the time till you see the time out error, that is 10 min, you're at most sending 65535 / 600 = 109.225 events / sec to Finder. You can reduce the number of events by inserting some delay, e.g. 'delay 1' in your repeat loop but it can only defer the failure.
    cf.
    Re: Timed Out (Silence)
    http://lists.apple.com/archives/applescript-users/2009/Oct/msg00117.html
    Re: spurious timeout on nth Apple event on Snow Leopard
    http://lists.apple.com/archives/applescript-users/2009/Nov/msg00041.html
    A better way to achieve your task would be to let a launchd agent watch the file.
    A recipe is as follows.
    1) Save a compiled script in :
    ~/Library/Scripts/launchd/watchdog.1.scpt
    with contents :
    --SCRIPT
    -- Here put your script that is to be triggered when the file is modified.
    -- e.g.
    tell application "System Events"
    display dialog "The file is modified." giving up after 10
    end tell
    --END OF SCRIPT
    2) Save a UTF-8 plain text file in :
    ~/Library/LaunchAgents/watchdog.1.plist
    with contents :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>watchdog.1</string>
    <key>Disabled</key>
    <false/>
    <key>Program</key>
    <string>/usr/bin/osascript</string>
    <key>ProgramArguments</key>
    <array>
    <string>osascript</string>
    <string>/Users/USER_NAME/Library/Scripts/launchd/watchdog.1.scpt</string>
    </array>
    <key>WatchPaths</key>
    <array>
    <string>POSIX_PATH_TO_THE_FIILE</string>
    </array>
    </dict>
    </plist>
    *Change USER_NAME to your user name and POSIX_PATH_TO_THE_FIILE to the POSIX path to the file to be watched.
    3) Issue the following command in Terminal to load the launchd agent :
    launchctl load ~/Library/LaunchAgents/watchdog.1.plist
    Or
    3a) Log-out and re-log-in to load the launchd agent.
    *The name 'watchdog.1.plist' and 'watchdog.1.scpt' and the script's location '~/Library/Scripts/launchd/' are mere examples. You may change them as you see fit.
    cf.
    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/m an5/launchd.plist.5.html
    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/m an1/launchctl.1.html
    Good luck,
    H
    Message was edited by: Hiroto (fixed typo)

  • Nested Repeat Loops in Applescript

    The following code has two lists: myURLs and myIMGs. I want to loop through the sites listed in myURLs, take a screenshot, then save them in my Shared folder as the file name listed in myIMGs. So, google.com's image will be saved as "google.jpg", and so forth. The list in myIMGs corresponds to the list in myURLs.
    This is what I have, but it doesn't quite work. It loads the first URL from myURLs, takes a screenshot of it, but then loops through each file name in myIMGs and saves that one screenshot with all those various file names. Then, it loads the next URL in myURLs and does the same thing. How do I set the file names in the myIMGs list to correspond to the URLs being loaded from myURLs? I'm having trouble with the nested loops.
    set myURLs to {"https://google.com", "https://wikipedia.org", "https://bing.com", "https://apple.com"}
    set myIMGs to {"google.jpg", "wikipedia.jpg", "bing.jpg", "apple.jpg"}
    -- Sets settings of Safari without interferring with user's settings.
    repeat with myURL in myURLs
              tell application "Safari"
                        set myDoc to front document
                        set windowID to id of window 1
                        do JavaScript ("window.open('" & myURL & "','_blank','titlebar=0');") in document 1
      close window id windowID
                        set the bounds of the front window to {0, 20, 915, 812}
      delay 5
              end tell
    -- Screengrab, crop and save to Shared folder
              repeat with myIMG in myIMGs
                        do shell script "screencapture -o -l$(osascript -e 'tell app \"Safari\" to id of window 1') /Users/Shared/" & myIMG
                        set this_file to "Macintosh HD:Users:Shared:" & myIMG
                        try
                                  tell application "Image Events"
      -- start the Image Events application
      launch
      -- open the image file
                                            set this_image to open this_file
      -- get dimensions of the image
                                            copy dimensions of this_image to {W, H}
      -- Crops off the Safari header
      crop this_image to dimensions {W, H - 50}
      -- save the changes
                                            save this_image with icon
      -- purge the open image data
      close this_image
                                  end tell
                        end try
              end repeat
    end repeat

    Switch to an indexed loop and you don't need the extra repeat loop; you can run the two lists in parallel. See my changes in red:
    set myURLs to {"https://google.com", "https://wikipedia.org", "https://bing.com", "https://apple.com"}
    set myIMGs to {"google.jpg", "wikipedia.jpg", "bing.jpg", "apple.jpg"}
    -- Sets settings of Safari without interferring with user's settings.
    repeat with i from 1 to (count of myURLs)
              tell application "Safari"
                        set myDoc to front document
                        set windowID to id of window 1
                        do JavaScript ("window.open('" & item i of myURLs & "','_blank','titlebar=0');") in document 1
                                  close window id windowID
                        set the bounds of the front window to {0, 20, 915, 812}
                                  delay 5
              end tell
      -- Screengrab, crop and save to Shared folder
              do shell script "screencapture -o -l$(osascript -e 'tell app \"Safari\" to id of window 1') /Users/Shared/" & (item i of myIMGs)
              set this_file to "Macintosh HD:Users:Shared:" & myIMG
              try
                        tell application "Image Events"
      -- start the Image Events application
                                  launch
      -- open the image file
                                  set this_image to open this_file
      -- get dimensions of the image
                                  copy dimensions of this_image to {W, H}
      -- Crops off the Safari header
                                  crop this_image to dimensions {W, H - 50}
      -- save the changes
                                  save this_image with icon
      -- purge the open image data
                                  close this_image
                        end tell
              end try
    end repeat

  • Repeat loop in filemaker Pro 7 database

    How can I get my script to loop through a large FM database of records and change the data in a particular field as in the script below? I cannot figure out the syntax for the repeat loop...
    with timeout of "3000" seconds
    tell application "FileMaker Pro"
    go to database "CPA FM Log Copy"
    show every record of database "CPA FM Log Copy"
    set theCount to number of record of database "CPA FM Log Copy" as integer
    repeat with i from record theCount of database "CPA FM Log Copy"
    if field "ph" of record i of database "CPA FM Log Copy" is "NG" then
    set data field "ph" of current record of database "CPA FM Log Copy" to "Nice Going"
    else if field "ph" of record i of database "CPA FM Log Copy" is "EC" then
    set data field "ph" of current record of database "CPA FM Log Copy" to "Everything Cool"
    end if
    end repeat
    end tell
    end timeout

    Depending on the number of records in the database, this isn't the most efficient way of doing this.
    You should use a 'whose' clause in your script to narrow the FileMaker results to the subset of records you want to change, then change them all at once. This is far more efficient than looping through thousands of records in AppleScript looking for the ones you want.
    This should get you on the right track:
    <pre class=command>tell application "Filemaker Pro"
    go to database "CPA FM Log Copy"
    set theResults to every record of database "CPA FM Log Copy" whose field "ph" is "NG"
    set data field "ph" of every item of theResults to "Nice Going"
    set theResults to every record of database "CPA FM Log Copy" whose field "ph" is "EC"
    set data field "ph" of every item of theResults to "Everything Cool"
    end tell</pre>
    In this way you let Filemaker do the searching (which is what it's optimized for), and your script does the least work necessary.
    BTW, just so you know why your original script fails, it's because you say:
    <pre class=command>set data field "ph" of current record of database "CPA FM Log Copy" to "Nice Going"</pre>
    Note that you're always setting the 'current record'. This means that even if there are 1000 records in the database, you only ever set the first field. If you wanted to maintain the repeat approach this would have to change to something like:
    <pre class=command>set data field "ph" of record i of database "CPA FM Log Copy" to "Nice Going"</pre>
    so now it uses the loop iterator to track which record to change. An even better model that does use a scalar index is to do something like:
    <pre class=command>repeat with curRecord in every record of database "CPA FM Log Copy"
    if field "ph" of curRecord is "NG" then
    set data field "ph" of curRecord to "Nice Going"
    end if
    end repeat</pre>
    This nice thing about this model is that it uses FileMaker's internal references for records so that you know you're changing the right thing. This can be crucial if working in a multi-user database where there might be someone else is editing the data in parallel, changing theCount.

  • Repeat loops and goto's

    Can I ask two questions please,
    Q1.
    is there a way of telling a repeat loop to 'step' over
    numbers, I cannot find anything in the help files that mention this
    at all....
    For example, repeat with i := 1 to 200 'step 2' This would
    result in values of 1, 3, 5, 7, etc etc
    For example, repeat with i := 1 to 200 'step 3' This would
    result in values of 1, 4, 7, 10, etc etc
    Q2.
    Goto commands in a calculation icon.
    I can only find a reference that will use the
    goto(IconID@"TARGETICON") Is there anyway I can use the goto
    command inside a calculation. I need to set up a logical test,
    basically to say that if this isn't true go back to here and do it
    again(a repeat loop won't work)
    One day I think I may just get the hang of
    this.........

    I didn't examine your code closely, but for the future, if
    you need to
    randomly pull values from a list and you don't want
    duplicates...
    Copy the list to a new list, then after you pull a value from
    the list
    within the loop, immediately use DeleteAtIndex to remove that
    value from
    the temporary list. So during the next iteration of the loop,
    the
    previously pulled value is not present to be pulled again.
    Erik
    The Pc Doctor wrote:
    > Many thanks for your suggestions, I think I just got
    caught up the my knowledge
    > of VB and the for next loop, the solution was so obvious
    now you mention it.
    >
    > The second one I've also solved by way of different
    Calculation icons. Here
    > is what I was doing (Please forgive the awful code, I am
    still new at this)
    >
    > The whole point of this is to select a chosen number of
    Questions from a list
    > of a certain amount of questions - the numbers are not
    known and is subject to
    > change.
    >
    > I would seed a random numbers (between 1 and QNo) into a
    list of up to Q0
    > numbers and then use the below code to check to any
    duplicate numbers. The
    > problem I had was finding a way of if I found duplicate
    numbers replacing them
    > and testing them again, and again until no duplicates
    exist.
    >
    > I put the below in it's own calculation icon called
    'CheckIt'
    > - - - - - -
    > SortByValue(QuestionStore, TRUE)
    > again := 0
    > repeat with i := 1 to Q0 - 1
    > if QuestionStore = QuestionStore then
    > QuestionStore := Random(1,QNo,1)
    > again := 1
    > end if
    > end repeat
    > - - - - - - - -
    > I then put the following in a following calculation Icon
    > - - - - - - - -
    > -- Test to see if we have duplicate numbers, if yes then
    go back to the check
    > random numbers Icon.
    > if again = 1 then
    > GoTo(IconID@"CheckIt")
    > end if
    > - - - - - - - - - -
    >
    > Well it works
    >
    > Thanks again
    >
    > Paul
    >
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - Authorware
    http://www.macromedia.com/support/forums/team_macromedia/
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    *Search the A'ware newsgroup archives*
    http://groups.google.com/groups?q=macromedia.authorware

  • Slideshow Transitions When Repeating Loop

    Hello,
    I've created a slideshow using many photos that I want to repeat/loop indefinitely. I've fixed the transition at the end so it doesn't fade to black, however, when the last slide ends, it doesn't transition to the first slide as I wanted.
    All of the transitions are dissolves except for the cut transition from the last slide to the first slide. Any ideas how on how to make every transition a dissolve....even when repeating?
    Thanks so much....

    Anyone?

  • Interrupt repeat loops with buttons

    Hi,
    How do I make buttons available to the user while I run a repeat loop?
    I'm doing a shell script in the background and I'm using a repeat loop to read out the log of the results. Meanwhile, I want to have a Cancel button available to the user.
    The button however doesn't respond while the repeat loop runs, while the rest of my UI is in fact updating (based on the incoming log). I'm even using a one second delay at the beginning of the loop.
    I'm using AppleScript Studio in Xcode/Interface Builder.
    Thanks,
    JW

    1. Create a control in the window which has some sort of boolean property (if you are using a progress bar, then you already have one, since a progress bar can be indeterminate, and you can check this).
    2. Set the handler which shows the window (or alters the window when the process begins) to set this boolean property to a particular value
    3. Have the "Cancel" button handler invert the property
    4. Have the repeat loop check the property as part of its boolean condition (as in "repeat while x is true")
    Note that if the window is going to go away anyway when the process is complete, then you can use the window's title to indicate the status: set the title to "Cancelling..." and have the repeat loop check whether the title of the window is "Cancelling...".
    You could also just create a global within the script file, and have the repeat loop check the status of the global, but that tends to lead, sooner or later, to overlapping reuse of a single global value, which is a bug.

  • How do I repeat loop a video file from iPod Touch to Apple TV ?

    I have an iPod Touch that is a few years old but running the latest software update.  I want to loop a video to then play through Apple TV onto 2 panels at the front of our shop.  I have saved the file as a video and Music Video (using Get Info etc) but neither version in the iPod touch will supply the repeat function - it works fine from my MacBook Pro but I cannot leave this in the shop overnight.  Any assistance would be greatly appreciated - evern if a third party app that actually works.  Thanks in advance, Shaun.

    This worked on older iOSs an may still work
    How to make a video repeat on iPod?: Apple Support Communities

  • Am I doing this repeat loop wrong?

    I'm writing an AppleScript to transfer layers from OmniGraffle 5 to Adobe Illustrator. It copies the first OmniGraffle canvas perfectly, but when it gets to the second canvas, it copies the last layer of the previous canvas instead. This might be an issue with how I'm changing the layers' "visible" setting at different times. But if is, I don't understand why this would work for the first canvas but not the second when they use the same code.
    Any suggestions on how to fix this loop would be greatly appreciated.
    set myDocument to "[file path]"
    tell application "OmniGraffle 5"
    set oDoc to open myDocument
    repeat with theLayer in every layer in every canvas in oDoc
    set visible of theLayer to false
    end repeat
    repeat with currentCanvas in every canvas in oDoc
    set canvasName to name of currentCanvas
    repeat with currentLayer in every layer in currentCanvas
    set visible of currentLayer to true
    set layerName to name of currentLayer
    (* this allows the second layer to be copied *)
    tell application "OmniGraffle 5"
    activate
    end tell
    tell application "System Events"
    keystroke "a" using {command down}
    keystroke "c" using {command down}
    end tell
    tell application "Adobe Illustrator"
    set AIDoc to (make new document)
    save AIDoc in canvasName & "-" & layerName & ".ai"
    activate
    tell application "System Events"
    keystroke "v" using {command down}
    end tell
    end tell
    set visible of currentLayer to false
    end repeat
    end repeat
    repeat with theLayer in every layer in every canvas of oDoc
    set visible of theLayer to true
    end repeat
    end tell

    well I don't use OmniGraffle, and I don't have Illustrator installed, but the problem is almost certainly with the way you're using GUI scripting (which is unnecessary in this case). try either of the following approaches. you'll have to play with them because (as I said), I don't have the software to test it on. note, for instance, that I'm just guessing that "contents of AIDoc" is a valid reference - I know that Illustrator has some means of addressing the contents of a document, but 'contents' may be the wrong keyword.
    <pre class="jive-pre">
    set myDocument to "[file path]"
    tell application "OmniGraffle 5"
    set oDoc to open myDocument
    repeat with currentCanvas in every canvas in oDoc
    set canvasName to name of currentCanvas
    repeat with currentLayer in every layer in currentCanvas
    set layerName to name of currentLayer
    set the clipboard to currentLayer
    tell application "Adobe Illustrator"
    set AIDoc to (make new document)
    save AIDoc in canvasName & "-" & layerName & ".ai"
    set contents of AIDoc to the clipboard
    end tell
    end repeat
    end repeat
    end tell</pre>
    or if you want to avoid calling the clipboard at all, try setting the layer directly into Illustrator.
    <pre class="jive-pre">
    set myDocument to "[file path]"
    tell application "OmniGraffle 5"
    set oDoc to open myDocument
    repeat with currentCanvas in every canvas in oDoc
    set canvasName to name of currentCanvas
    repeat with currentLayer in every layer in currentCanvas
    set layerName to name of currentLayer
    tell application "Adobe Illustrator"
    set AIDoc to (make new document)
    save AIDoc in canvasName & "-" & layerName & ".ai"
    set contents of AIDoc to currentLayer
    end tell
    end repeat
    end repeat
    end tell</pre>
    also, it's bad practice to call one app from within another app like this - it creates confusion, and sometimes even generates keyword conflicts. if would be a lot better to move the whole 'tell application "Adobe Illustrator"' block into a subroutine (call it writetoIllustrator(...)), and then call the subroutine with 'my writetoIllustrator(...)' to break it out of the OmniGraffle tell block.

  • Repeating/looping animation layers

    I have an animation with 8 pictures. The pictures fade in and
    fade out. So, for example, pic 1 fades in and then stays
    steady/solid for some time and then fades out, just as pic 1 fades
    out, pic 2 fades in and so on. But the problem arises once the
    process repeats. As the last picture is fading out, pic 1 is fading
    in and a quick white background appears and then pic1 reappears
    because the animation has looped back to the beginning. How can I
    get the last picture to fade out and the first pic to fade in look
    like the other transitions? I want to avoid the white background
    from showing up and have a smooth transition like the other ones.
    Thanks

    As the last pic fades out, fade in the first pic. Sounds like
    you are doing that.
    Then on the very last frame, put in the Actions panel:
    gotoAndPlay("loop");
    Then go to the frame near the beginning (but not the first
    frame) where pic 1 has just finished fading in, so it is solid.
    Select that frame and in the Properties panel put "loop" in the
    lower left in the <Frame Label> text box.

  • Repeated/Looping App Download Failures in iTunes

    All:
    My iTunes store has repeatedly failed to download a new app (Monkey Island) since late last week along with an app update for Beatkmaker which occurred Sunday evening.
    Behavior is as follows:
    Purchased app through App Store
    Download begins
    Download goes through to the end
    File apparently does not verify
    Download starts again automatically
    Continue loops of above.
    Steps I've taken follow:
    (1) Attempted downloads of the App from three separate internet connections - cable via Cox Communications, mobile wireless via a Sprint wireless modem, and my ATT 3G connection. Nothing. Zip. Nada.
    (2) Deleted iTunes from my hard drive and re-installed using the latest disc image from Apple (v8.2.1) - even though this was the version I already had on my computer.
    (3) Ran Disk Utility after booting from the OS-X CD and verified/repaired all permissions as well as verifying no problems with the hard drive.
    (4) If I allow my phone to attempt this, it runs the battery rapidly down to zero and actually heats the iPhone up to a point where I have to shut it down.
    (5) I still cannot get the download "shadow" icon off my iPhone.
    (6) I attempted to download seven iPhone App updates with the following results:
    PhotoBuddy - 1.2mb - SUCCESSFUL DOWNLOAD
    Pocket God - 10.3mb - SUCCESSFUL DOWNLOAD
    Star Hogs - 40.5mb - SUCCESSFUL DOWNLOAD
    Hear Planet - 1.1mb - SUCCESSFUL DOWNLOAD
    MyWeather - 3.7mb - SUCCESSFUL DOWNLOAD
    Beatmaker - 163.8mb - FAILED TO DOWNLOAD - BEHAVIOR IDENTICAL TO MONKEY ISLAND. Provided additional error message after three download loops:
    stopped (err= -1000000)
    (7) This would appear to me to be a problem from Apple's side with large file downloads via iTunes. I don't know what the size limit of a successful download is at this point (obviously somewhere between 40.5mb and 163.8mb).
    (8) Note above that I first purchased Beatmaker sometime in 2008 and there have been multiple updates of this App since then.
    (9) I've had no problems with app downloads and phone updates until the 3.0 iPhone update AND corresponding iTunes store update happened around 6 weeks ago. I had to take my wife's phone into an Apple store for it to be restored last weekend after unsuccessfully trying to update the phone from 3 different Macs and a PC.
    (10) Test downloaded a 285mb file from a non-Apple FTP server and it came through fine.
    I look forward to any help out there.....a real puzzler....Apple has not responded to the problem via iTunes store support yet....hence my posting here.

    Same here. 1g running 3.1.3.  Can't download or stream any podcasts though iTunes.
    I share the hope that this is just temporary.  This would be worse that merely abandoning the 1G.  This would be eliminating existing functionality.

  • Controlling and directing a repeat loop

    I thought I was getting the hang of applescript, but have been working on this one for a few days to no avail...must be an easy solution and I just don't see it. Anyway... I have a set of data in Excel that I have successfully read into a list and am trying to use the data to control the way it is put into another Excel file, specifically a number of different sheets within a series of Excel files. I'll post the entire script I have at the bottom of this post, but essentially here is the issue: If a list has something like {{2010,B,T001,201},{2020,C,T001,202},{2020,C,T002,301}} how might I use the fact that the third item in the list of lists (think I am saying that correctly) changes to control where the script puts the data. In other words I want the last set of data {2020,C,T002,301} to go to another Excel sheet based on the fact that it has a different value in the third item as compared to the earlier sets of data...hope I haven;t confused you! Here is the script that I "working" right now.
    Thanks,
    dan
    <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 the Script Editor">
    -- Works with an Excel file [csv is ok] to move scheduled sections from one Excel file into another Excel file set up as a daily Schedule  for the courses taught by a teacher.  Each daily schedule file will be dept based and have multiple workbooks--
    tell application "Microsoft Excel"
    activate
    open file "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:09-10 Teacherdata.xlsx"
    activate object workbook "09-10 Teacherdata.xlsx"
    activate object worksheet "Sheet 1"
    get value of used range of worksheet 1 of file "MacBook HD:Users:Dano:Desktop:09-10 Teacherdata.xlsx"
    copy the result to wholedata
    set lvalue to length of wholedata
    set counter to lvalue
    set cellnum to 1
    set cellid to ""
    set slotvalue to ""
    set deptname to {"English", "Humanities", "Mathematics", "Language", "Science", "Arts"}
    set deptnamefile to {"MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:English Schedules 10-11.xlsx", "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:Humanities Schedules 10-11.xlsx", "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:Mathematics Schedules 10-11.xlsx", "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:Language Schedules 10-11.xlsx", "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:Science Schedules 10-11.xlsx", "MacBook HD:Users:Dano:School:Scheduling:Applescript & Excel Files:Arts Schedules 10-11.xlsx"}
    set columnchoices to {"J", "K", "L", "M", "N", "O", "P", "Q"}
    set teachingslot to {"A ", "B ", "C ", "D ", "E ", "F ", "G ", "H "}
    set cvalue to {0, 0, 0, 0, 0}
    set tid to ""
    repeat with i from 2 to counter
    copy item i of wholedata to cvalue
    copy item 3 of cvalue to tid
    repeat with i from 1 to 6
    if item 5 of cvalue = item i of deptname then
    if item 3 of cvalue = tid then
    tell application "Microsoft Excel"
    activate
    open item i of deptnamefile as alias
    activate object worksheet 1
    set nextfile to item i of deptnamefile
    end tell
    copy item 2 of cvalue to slotvalue
    repeat with i from 1 to 8
    if slotvalue = item i of teachingslot then
    if tid = item 3 of cvalue then
    set cellid to item i of columnchoices & "3"
    set formula of cell cellid to item i of teachingslot
    set formula of cell "J1" to item 3 of cvalue
    save
    else
    activate object worksheet 2
    set cellid to item i of columnchoices & "3"
    set formula of cell cellid to item i of teachingslot
    set formula of cell "J1" to item 3 of cvalue
    save
    end if
    end if
    end repeat
    tell application "Microsoft Excel"
    close workbook 1 saving yes
    end tell
    end if
    end if
    end repeat
    end repeat
    set onepiece to {}
    set lastrow to {}
    set courseID to {}
    end tell </pre>

    ok...thanks to the last 2 posters for the help. I think this is moving me in the right direction, but have a few questions/points:
    You're welcome Dan! Let me see if I can help some more...
    when I use ...repeat with aList in theList is "aList" a variable that I have to define or does it pull off the a list at a time from a list of lists (that's what I'd like it to do).
    aList is a variable that contains a list. It is what you're wanting it to be.
    Not sure I understand the command... log "made new spreadsheet " & lastThirdItem what is this log command? (guess I'll look into this, although it isn't in my Applescript book (Applescript 1-2-3))
    The log command is useful to "log" information in your script as it goes along. It's primary use is for debugging a script. If you click on "Events" (located at the bottom of the ScriptEditor window, just to the left of "Replies" and "Result"), you can watch for useful information about the progress of your script as it executes. The log command can be safely omitted.
    Point of clarification: my list that includes {"20501", "B", "T1441", "201", "Humanities"} is large... 280 rows of data, and it changes from year to year. Since it is in Excel I can sort it and group the data based on the 3rd item ("T1441"), but the number of times this variable shows up...varies and thus I guess I'm looking for a way to load the data into a list and then have Applescript work through it parsing the data that has the same 3rd item into one worksheet, and then the next group of data that has the same 3rd item into another worksheet and so on, with the 4th item controlling the workbook it is going to. I think I might just start from scratch after looking into these alist and log commands.
    If I'm understanding you correctly, the following script example should get you started in the right direction to achieve what you are looking to do...
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">set theLists to {{"20501", "B", "T1441", "201", "Humanities"}, {"10601", "A", "T1561", "102", "English"}, {"20502", "D", "T1441", "201", "Humanities"}, {"20503", "F", "T1441", "201", "Humanities"}, {"36251", "E", "T1661", "103", "History"}, {"20504", "H", "T1441", "201", "Humanities"}, {"10101", "J", "T1661", "103", "History"}}
    set thirdItemList to {}
    repeat with aList in theLists
    set thisThirdItem to item 3 of aList
    if thisThirdItem is not in thirdItemList then copy thisThirdItem to end of thirdItemList
    end repeat
    repeat with thisThirdItem in thirdItemList
    set thisItem to thisThirdItem as string
    --make new spreadsheet
    log "made new spreadsheet " & thisThirdItem
    repeat with aList in theLists
    if (item 3 of aList) as string is thisItem then
    --do stuff to spreadsheet
    log "adding info to spread sheet " & thisThirdItem
    end if
    end repeat
    end repeat</pre>
    The above script finds each different third item and makes a list of those. It then creates and appends information to one spreadsheet at a time until all third items have been accounted for. Harder to explain than to show someone in person! Run the above script in the ScriptEditor application and watch the "Events" log.
    thanks,
    dan
    Again, you are welcome. I wish you luck my friend! Hope this helps some more...

  • 2.0 firmware spontaneously restarting repeatedly/loop

    I just bought the 2.0 firmware. It installed fine. I really like it and cant wait until the next upgrades.
    However, my one complaint is that it goes into spontaneous restart/shutdown/restart/shutdown loops. Goes for about 20 minutes before I can finally get control back.
    The weird thing is that this also happens when I try and shut off my Touch.
    Any ideas/helps?

    Rohan Thompson,
    Have you tried resetting network settings on the iPhone yet? To do so, just navigate to Settings > General > Reset > Reset Network Settings.
    If the issue persists beyond that, I would recommend restoring the iPhone and setting it up as a new phone. More information on that can be found here: http://support.apple.com/kb/HT1414
    Hope this helps,
    Raleigh

  • I have a movie track and in that track I have a video loop of 10 seconds.  I want that video loop to repeat (loop) throughout the entire project.  How can I do this?  Right now there is a fades out white space after the video clip

    I am working on a Garage Band Podcast.  I have a 10 second video clip in the Movie track and want to loop it for the entire project.  How can I co this? 

    Sounds like maybe you're using the same channel strip on multiple tracks? Make sure you're creating a new software instrument channel strip for each independent instance of Ultrabeat you want to have. If you use the same CS, then all tracks that use it will have to have the same kit.

Maybe you are looking for

  • Is there any way to create backing bean, After page gets created?

    Hi Any one can please answer to my quick question !!! Is there any way to create the backing bean ,after a jsf page gets created using ADF ..? When i first time created the jsf jppx page i unchecked the option to generate backing bean, but later some

  • HT1495 When I try to open iTunes on my PC it it's locked and won't open?

    When I try to open iTunes on my PC it it's locked and won't open?

  • Project for school - I encountered some problems

    School gave me and my team a assignment to make a simulation of a floor-robot called Robbie. You can see Robbie as a plotter it is a round robot with a pen that it can turn on or off. The simulation should be of a remote control which gives commands

  • Inserting multiple records from a QofQ?

    I'm doing (still!) an app for parents to sign up for information from their child's school, and giving them the option to choose more than one grade using checkboxes. I'm passing the grades as a string, then parsing them into individual searchable gr

  • Internal mechanism of User changes

    One End (XYZ) user is login to the system, As a security person i am assigning one role to end user.it is immediately impact to (xyz) user.more over i am changing address, locking/unlocking,reset password... is not immediately  impacted to user...whi