![]() |
Applescript Quicktime Open Image Sequence
Hi,
I have a series of many folders containing individual image sequences that I would like to make movies out of using quicktime pro. Given the large number of folders I must do this for I would like to automate the task with applescript if possible. Unfortunately I have no experience with the language and don't quite know where to start. Can anyone provide any help to get started with this project? I imagine it shouldn't be difficult for someone with some applescript experience, and I'd really appreciate the help! Thank you! |
not enough details man
see if you can do the whole process using only the keyboard, if so you will very easily be able to script your operation. |
You could try this folder action.
Attach it to an empty folder, then drop folders of image sequences onto that folder. The movie will be saved inside the image sequence folder, with the first image's name as the movie name. Hope that helps. Code:
on adding folder items to thisFolder after receiving droppedFolders |
perfect
Thanks, this helps a lot. hope it wasn't too much trouble
|
This seems very helpful for me as well, but I've encountered a problem. This script doesn't give the possiblity to set the framerate to 25, which is vital for me. I've checked the applescript dictionary on this and here's what I get :
"open image sequence file : the file representing first image of the image sequence [frames per second real] : the number of desired frames per second [seconds per frame real] : the duration of each frame in seconds" Looks obvious..but.. I can't figure out how or where to enter the values on this. Any ideas ? Thx Jan |
From that dictionary info, I think you just put the "frames per second" immediately following the filename in the "open image sequence" command.
E.g. here's an example from: http://news.lugnet.com/trains/?n=19805&t=i&v=a (which I found by googling for: "open image sequence" "frames per second") Code:
open image sequence thePath & ".1" frames per second 25 |
Hayne found the answer before I did.
Code:
on adding folder items to thisFolder after receiving droppedFolders |
woow
Thx lads. This makes my life quite a bit easier. Don't know if I could bother you with one more question on this script. But is there any code I could enter to save the quicktimes in the folder above the sequencefolder, so, inside the actual folder action place ? I tried setting it as : save self contained in "hard disk:document: etc..." but then it just asks me if I want to save 'untitled' ;-) Jan |
Not a problem.
This script could be condensed, but then you would have a harder time seeing what it does. And it could use some tweaking and error checking (make sure the name isn't too long or a file won't be overwritten) but you can tinker - and ask for help again if you need it. Check out MacScripters for more AppleScript information and help - http://bbs.applescript.net/ Code:
on adding folder items to thisFolder after receiving droppedFoldersCode:
set aFolder to choose folder |
Hey, this is great, and well-timed. I need to set up something to do this automatically with images being pulled off a webcam and then transferred to an ftp site, which I'll probably do with expect...
How do you set a particular folder in the script, where the images will be stored? ie-I can't have "choose folder" in there... -thanks... |
A variation on the theme...
Thanks for the inspiration capitalj - I have been able to use it as well.. but have some challenges.
I used the following Code:
tell application "QuickTime Player"My challenge is that I need to use the script on a machine that is running 10.4. but it throws an error: QuickTime Player got an error: NSReceiverEvaluationScriptError: 4 It starts up Quicktime ok but doesn't seem to open the image sequence let alone store the file. Any idea what it could be? Thanks in advance! |
Hello nik_it
The first problem I see is that you used the POSIX path (with slashes, a bit about them here) and the second is that the path is incomplete. Assuming your pictures folder is in your home folder, this: Code:
"/Pictures/photo1.jpg"Code:
"Macintosh HD:Users:YourUserNameHere:Pictures:photo1.jpg"Code:
--replace YourUserNameHere with your actual user nameI've never tried using "save self contained document "Untitled" in..." before, so I learned something today, thanks. |
capitalj - thanks a million for the quick reply.
I actually created folders under the root (Mackintosh HD:Pictures and Mackintosh HD:Movies) just to see if my path was the problem. I can move them back to the home folder and try your suggestions. Quote:
Quote:
|
I'm afraid your suggestions didn't show any change...
This is so frustrating.. I can't get Quicktime to do ANYTHING with the Script Editor aside from Code:
activate application "QuickTime Player"Code:
tell application "QuickTime Player" to quitI tried a one line of code approach, opening Quicktime and then executing Code:
tell application "QuickTime Player" to open image sequence "Mackintosh HD:Users:UserName:Pictures:inside:inside1.jpg" frames per second 10Do you have any ideas what I could be doing wrong or what I should test? |
Quote:
|
Thanks capitalj - you certainly helped but it wasn't exactly what you said... you see - I had renamed my HD to "BigD" but changed the name to the more standard Macintosh HD (at least that was my intent ;-) after pasting the code into the example.
But after your post, I decided to see what the Mac gave me as a path if I asked automator to select the file. So in automator I created a short script Get Specified Finder Item View Results Here's what I got: {alias "BigD :Pictures:inside1.jpg"} So it does work having the Pictures folder under the root - for some reason, it inserted a space after the HD name and I had no idea... Thanks a million! It works now! |
Hi,
I'm digging up this thread because I've a quite similar case... I'm a total noob at scripting so I didn't understand everything that was said here... anyway here's my problem/workflow need: I have a lot of image sequences conversion to do using Quicktime so what I do is open the first sequence and export it with the Apple ProRes codec under the same name than the sequence... and I've to do this twice, first time in HD 1080 then in PAL letterboxed (720*576) now first of all, the naming part. my sequences are named like this "040_002_v03.01.jpg" and I just want to keep the first part with the underscores and remove the ".XX.jpg" part. The scripts showed above keep all of the name and just add .mov at the end of it... then I wonder if it is possible to "recognise" all the sequences present in a folder because I have like 100 sequences under the same folder sometimes and ultimately what I was hoping was to make a droplet (or 2) on which I would just drag a folder full of images and let it sort the sequences by name. well then of course you have the export process. Can one script something like the choice of a particular codec and image size and ratio? I've found somewhere an automator action which export a movie sequence through the last prefered output options and that would also work for me since I only use one at a time... Of course I'm not asking for a ready-to-use script response but for someone to tell me what would be possible and what would not as I will try to mix automator actions and applescript... thanks for your time reading this, hope you would excuse my grammar mistakes... |
do i understand this correctly?
i attached the following version of one of these scripts to a folder, directly copied from the above, previously posted version, and absolutely nothing happens when i copy items to the folder. i lie. if i copy the first file of an image sequence to the folder, the file simply appears in the new location. if i drop the entire image sequence folder into the folder with this script attached, the sequence folder disappears from the finder and qt player never opens. i have to cmd-z to get the folder back. on the other hand, if i run the script from the editor, qt player opens the sequece as expected and renders out a mov file. am i missing something? am i not correct that i should simply drop my sequence folder into the folder with this script attached to have a mov automatically generated from the contained sequence? script editor Version 2.2 (2.2) osx 10.5.5 thanks (complete n00b to this, btw), BabaG Code:
set aFolder to choose folder |
Selected folder contents to quicktime movie
These are great time saving solutions but not what I'm looking for exactly. I would like to create an automator action most likely with a custom apple script I'm assuming to create a movie from a selected folder and name the movie the name of the folder and save it in the directory of that folder. The reason being is this takes one step away from having to copy and paste the contents of a folder into the drop bin folder as the examples above and also I don't need to name the image sequence anything other than the image numbers. Also, I'm usually rendering off multiple sequences at a time so I can't just render to that folder.
It would be great if all I had to do is select the folder, right click on it and select the workflow from automator and it would save the contents as the name of the folder. It just seems like it would be better in my case. This thread is quite old but I'm hoping that someone is still watching it. Your help would be greatly appreciated. Thanks! |
With Snow Leopard and QuickTime 7, create a service in Automator using the "Run Applescript" action, and paste in following script (read through the thread to set frames per second if you need to).
Pre-Snow Leopard and with QuickTime Pro (if memory serves correctly), change "QuickTime Player 7" to "QuickTime Player" and save the workflow as a plugin. Code:
tell application "Finder" to set theSequence to (get first file of (input as alias) as alias) |
Thank you capitalj!
That worked great. The only thing is I might have not explained myself correctly when it comes to naming the file. I want it to be the same as the folder that I'm selecting that contains the files. So right now the script names it the name of the first file in the folder and saves it in the folder. So I want it to be named the folder name and saved in the same directory as the folder. The way it is right now is very useful but if I could get it that way that I just explained, that would really save me a lot of time. Thanks Again! |
Quote:
Code:
tell application "Finder" |
Excellent!!! It worked! Thanks! This is going to save me so much time.
The only thing I changed was where it saves it. I took out " ":" & theName " so that it saves the movie in the same directory as the folder. In my case, it's better because if there are hundreds of images, I'll have to scroll to find it. That's no fun. I'm sure that in some cases it would be better the other way though. Thanks Again! |
Quote:
|
CapitalJ you are a life-saver!!
This is exactly the workflow I have been working for! Hooray! Unfortunately I cannot get the revised script you posted that renames the imageSequence to the name of the folder to work with a dropped folder. I cut and pasted two of your scripts together and perhaps I have screwed up somehow?? Seems like it should work, but not getting anything.... What works (but doesn't rename): on adding folder items to thisFolder after receiving droppedFolders repeat with aFolder in droppedFolders tell application "Finder" to set theSequence to (get first file of aFolder as alias) tell application "QuickTime Player" activate open image sequence theSequence set nameSequence to (theSequence as string) & ".mov" tell document 1 with timeout of 900 seconds export to nameSequence as QuickTime movie using most recent settings end timeout close saving no end tell end tell end repeat end adding folder items to What doesn't work: on adding folder items to thisFolder after receiving droppedFolders repeat with aFolder in droppedFolders tell application "Finder" set theFolder to input as alias set thePath to container of theFolder as string set theName to name of theFolder set theSequence to (get first file of theFolder as alias) end tell tell application "QuickTime Player" activate open image sequence theSequence set imageSequence to thePath & theName & ".mov" tell document 1 with timeout of 1800 seconds export to imageSequence as QuickTime movie using most recent settings end timeout close saving no end tell end tell end repeat end adding folder items to I have taken the liberty of increasing the timeout interval since some of my sequences are quite long and QT was choking, but otherwise I think this should work. Only it doesn't... What am I missing? Thanks so much! |
Try this. (change "QuickTime Player 7" to "Quicktime Player" for pre-Snow Leopard.)
Code:
on adding folder items to thisFolder after receiving droppedFolders |
Resurection of fantastic script thread
Hi
This is my first post here. I'm using the script that capitalj posted as a folder action within automator. It's working beautifully, but.... There is always a but.. It won't let me drop multiple folders or a directory folder in it. If I do the script won't run and it just sits there. I've got thousands of consecutively named folders with 10,000 consecutive jpegs in them. What I would like to do is drop a directory folder into the "action" folder and have the movies saved in a separate folder in the "action" folder called 'movies' Here's the script I'm using; on run {input, parameters} repeat with theFolder in input tell application "Finder" set theFolder to input as alias set thePath to container of theFolder as string set theName to name of theFolder set theSequence to (get first file of theFolder as alias) end tell tell application "QuickTime Player 7" activate open image sequence theSequence set imagesequence to thePath & theName & ":" & theName & ".mov" tell document 1 with timeout of 500 seconds save self contained in imagesequence end timeout close end tell end tell end repeat end run Any input would be hugely appreciated. Adam |
| All times are GMT -5. The time now is 05:50 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.