FORUMS: list search recent posts

Automator Workflow: Export, Compress, Upload, Email to client

COW Forums : Apple Final Cut Pro Legacy

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jonny Elwyn
Automator Workflow: Export, Compress, Upload, Email to client
on Mar 27, 2012 at 8:26:06 am

Hello everyone,

I've been trying to create a system that will export from fcp, compress and upload via dropbox to a client in this way >>

1. export from fcp to a watched folder
2. once the file fully exports (file size stops growing) trigger a folder action to start compressor droplet
3. Compressor droplet exports to another watched folder (which waits for full file size) before copying the file into a dropbox public folder, an applescript copies the dropbox public link, launches chrome and emails the link to a chosen address.


Now it all works 'except' for the part of the scripting which makes sure that the file has been fully exported/compressed or copied (in all 3 different occurrences)

Here is the code I am using for the 'waiting for file size to stop' script to make sure that each stage completes before moving on to the next...This is as it appears in the 'run applescript' window in the automator workflows... (i don't want to 'pause' them with seconds as any given export/compression will be different sizes and therefore take different amounts of time)
------------------
on run {input, parameters}


on adding folder items to thisFolder after receiving theItems
repeat with f in theItems
-- wait for the item to be all there. Since it can take a few minutes for a file to copy over.
set Was to 0
set isNow to 1
repeat while isNow ≠ Was
set Was to size of (info for f)
delay 30 -- longer if getting the item is slow
set isNow to size of (info for f)
end repeat -- get next item f in thisFolder
end adding folder items to

return input
end run

------------------------------
BUT when i run the code by itself - automator says it isn't written correctly...(and it isn't working)

Also is there a problem in the way compressor exports (creates a dummy file appended -1 which is 4k big and then removes and replaces it with fully exported file when compressing is complete)
The problem is that my 'copy to dropbox' and copy link is happening too soon and so it copies the dummy file.

It all works separately (eg the code to copy the dropbox link and paste it into an email) but its just getting the applescript code to work that makes the process wait for the file to be either copied (so checking the file size until it stops growing) or is more than 4kb but then jumps to the final size for when it compresses. I just need to get the automator workflow to wait for the unique file specific length of time to then proceed to the next action...

any help you can give would be gratefully received!

jonnyelwyn.co.uk


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]