Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: quicktime export, 3gpp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quicktime export, 3gpp



On 12/22/05 4:31 AM, "Simon Scheiber" <email@hidden> wrote:

>
> Hi ­ can anyone help me with the following lines and tell me what is wrong
> with it, cause it seems that it doesn't want to work ­ I'm a new in
> Applescript, so thanks for any corrections...

[snip]

The most obvious errors are that your script says:

 on adding folder items to this_folder after receiving this_item

You should be aware that 'on adding folder items to' passes in the 'added
items' as a list. Even if there is only one file added, you still get a list
(a list containing one item, as it happens).
This means you probably need to loop through the list, processing each item
in turn, like:

 on adding folder items to this_folder after receiving these_items
 ...
 repeat with each_item in these_items
    open each_item
    -- do something to each_item
  end repeat

  end adding folder items to

The second error is that you're using an undefined variable:

 if (can export this_file as ThreeGPP) is true then

But 'this_file' is never defined in your script. I'm guessing you meant to
use 'this_item', not 'this_file'. However, given my point 1) above, this
should probably not be what was passed into the folder action script anyway.

Then we come to the issue of:

 export to this_folder & ":" & this_item & "_mobile.3gp" as ThreeGPP using
most recent settings

At best, assuming 'this_item' actually referred to a specfic file and not a
list, this still wouldn't work.
'this_folder' would be an alias like 'alias HD:path:to:some:folder' and
'this_item' might be "HD:path:to:some:folder:newfile.mp4".
When you stick them together like this you end up with:

 'export to HD:path:some:folder:HD:path:to:some:folder:newfile.mp4 as
ThreeGPP using most recent settings'

I doubt that's what you really intend.

You probably need to extract the file name from the current item and use
that, potentially using a different filename extension  to differentiate the
file type.

Oh, and you don't want to save it back to the same folder, either. Doing so
will trigger a new call to the folder action, which will save the file as a
Three3PP, which will trigger the folder action, which will save the file,
which will trigger the folder action... You get the idea, I'm sure.

You should probably also add some kind of check when processing these_items.
Your script will get called any time any item is placed in the folder,
including another folder. You either need to ignore folders (QuickTime can't
open a folder), or you need to look inside the folder for valid files,
depending on your needs.

Andrew
:)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >quicktime export, 3gpp (From: Simon Scheiber <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.