1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Add only Quicktime movies to list

Discussion in 'Mac Programming' started by thriftinkid, Apr 4, 2008.

  1. macrumors regular

    #1
    Hey guys, I have some compression software called autodesk cleaner 6.5.1. I am trying to add only the quicktime files from a folder called "finished" on my desktop. The problem is I can't get the files or even the folder to add to the render que. I get the following error:

    Cleaner 6.5.1 got an error: Can't make some data into the expected type.

    I posted the script I have, and the possible software dictionary commands that I think should somehow relate to getting this script to work. If anyone can help that would be great. I'm new to writing any kind of coding.

    script:
    tell application "Cleaner 6.5.1" to launch
    tell application "Cleaner 6.5.1" to (Add) / Users / comcastcable / desktop / Finished

    Possible commands:

    Add v : Add a file to the current batch

    Add alias : media item to add to the batch

    CustomFolderLocation n
    properties
    name (string, r/o)
    folderDestination (file specification, r/o)

    GetCustomFolderDestinations v

    GetCustomFolderDestinations
    → list of CustomFolderLocation

    AddCustomFolderDestination v

    AddCustomFolderDestination CustomFolderLocation : custom destination object to add

    SetItemCustomDestination v

    SetItemCustomDestination [DefaultLocation/FTPLocation/FolderLocation]
    [CustomLocation string]
    [CustomName string]
     
  2. macrumors G4

    Eraserhead

    #2
    Is this all AppleScript? Why are there [ and ] in it?
     
  3. macrumors regular

    #3
    Yes this is applescript

    Yeah, this is an applescript. When I wrote the script, script editor automatically put them in ().
     
  4. macrumors G4

    Eraserhead

    #4
    I'd go for:
    Code:
    tell application "Cleaner 6.5.1"
    	add (POSIX file "/Users/comcastcable/desktop/")
    end tell
    
     
  5. macrumors regular

    #5
    I tried out that script with reference to both the folder and the QT's themselves with the following and got this error:

    add (POSIX file "/Users/comcastcable/desktop/Finished")
    add (POSIX file "/Users/comcastcable/desktop/Finished/*.mov")

    Cleaner 6.5.1 got an error: File some object wasn't found.
     
  6. macrumors G4

    Eraserhead

    #6
    Try without the wildcards then.

    EDIT: Take a look at this thread for how to get a list of files.
     
  7. macrumors regular

    #7
    I tried it with the wildcards and I got the same results.
     
  8. macrumors G4

    Eraserhead

    #8
    The problem is that you have to get the individual files and then you have to get them in the right format, you may need to use Finder to get the files themselves. Have a play around with it. Applescript can be a bit of a nightmare.

    You might have better luck with Automator.
     
  9. macrumors regular

    #9
    I played around with the script this weekend referencing that link you suggested and I got it working. Thanks for all you help. That was a big step. I am actually using automator to make a plugin, but I had to write that script to get around an action that automator couldnt do.
     

Share This Page