Making applescript to batch shorten MP4's using quicktime player- 95% done

Hey guys, soo this is my first post and I'm hoping someone here could help me..
I downloaded a short script from someone, here it is:
+with timeout of 86400 seconds+
+ +
+ display dialog "Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop." with icon note+
+ +
+ tell application "Finder"+
+ set the startup_disk to the name of the startup disk+
+ end tell+
+ +
+ set user to do shell script "whoami"+
+ set inputfoldername to "Input"+
+ set input_folder to startup_disk & ":Users:" & user & ":Desktop:" & inputfoldername & ":"+
+ set user_desktop to startup_disk & ":Users:" & user & ":Desktop:"+
+ set output_folder to startup_disk & ":Users:" & user & ":Desktop:Output:"+
+ set file_extension to "_export.mp4"+
+ +
+ try+
+ tell application "Finder"+
+ make new folder at user_desktop with properties {name:"Output"}+
+ end tell+
+ end try+
+ +
+ try+
+ set thefolderlist to list folder input_folder without invisibles+
+ repeat with x from 1 to count of thefolderlist+
+ set the_file to input_folder & item x of thefolderlist+
+ set output_file to output_folder & item x of thefolderlist & file_extension+
+ tell application "QuickTime Player"+
+ activate+
+ open the_file+
+ export front document to output_file as MPEG4 using most recent settings with replacing+
+ close front document+
+ end tell+
+ end repeat+
+ on error+
+ display dialog "This script requires a folder named ‘" & inputfoldername & "‘ located on the desktop." with icon stop+
+ end try+
+ +
+ beep+
+ +
+end timeout+
That script is meant to export files as MPEG4. That is not what I want to do, I just want to shorten the video to -1 second, or 99% or something like that, then save it into the output folder. I would imagine doing this just takes 1 line in the right place but I am lost, I searched google but I can't find anything
can anyone help me please.. Here are the lines I think I need changed
+ tell application "QuickTime Player"+
+ activate+
+ open the_file+
+ export front document to output_file as MPEG4 using most recent settings with replacing+
+ close front document+
+ end tell+
how can I change that to trim the video???

That isn't working for me. When I hit 'compile', I get 'Expected end of line, etc. but found "from".'
Here is the code I have so far, I have changed it a bit. However my problem now is that it *never trims*
tell application "QuickTime Player"
activate
try
close front window
end try
open the_file
delay 3
set time_scale to get the time scale of the front document
set movie_length to get the duration of the front document
set time_original to movie_length / time_scale
set timetotrim to amounttotrim
set new_time to (time_original - timetotrim) * time_scale
select at 0 to new_time
trim
delay 1
export front document to output_file as MPEG4 using most recent settings with replacing
close front document
end tell

Similar Messages

  • Use QuickTime Player to convert movies to iPod video format......

    I don't know if this has been posted but, thought everyone might find it useful.
    You can convert quicktime movies to readable ipod video format without having to purchase Quicktime Pro. Thats right, just the Quicktime player.
    Now, I know that you can use Handbrake along with other converter programs for free. but just in case you want to use Quicktime Player here is a link that will show you how via applescript or automator.
    http://www.cs.brandeis.edu/~ari/scripts/Quicktime2iTunesVideo.html

    Here's a step-by-step of ONE of the ways (I have a Mac) you can convert your videos (mpgs) to mpeg4 files to view on your 5th gen iPods so your videos will have sound:
    I use Mpeg streamclip found on www.squared5.com.
    (This is from memory and I don't have the program opened in front of me so apologies if this is not totally accurate!)
    Once you've installed Mpeg streamclip, and opened up a new window, drag the mpg file you want converted onto the new window. You should now see the first clip of your video in the window.
    Go to File and choose "Export to MPEG4". This will open up another window. Click the button "iPod" on the upper right corner of the window and that will automatically input the settings for an iPod. Then click the button "Export to MPEG4" at the lower right corner of the window. You have to choose where you want your file saved. I just place them in the Videos folder of my hard drive. Then this will start the conversion of your mpg.
    Depending on how large your file is, this may take awhile.
    When the conversion is complete, simply take your new file (now with ".mpeg4" as an extension) and DRAG it into your iTunes library. I don't remember if you have to actually drag it onto your iPod as well.
    As you drag the mpeg4 file onto your iPod, it should say "updating song" at the top of you iTunes window, then you know it worked.
    So now you have a VIDEO on your iPod that plays SOUND!!
    Hope this was helpful.

  • I have lots of .MOV files on my iPhone5 that I need to transfer to my PC.  Using QuickTime Player 7.7.4 I am unable to view them once they have been copied to a hard drive or directly from the iPhone via USB. 1% of the time a vid is viewable

    I can tranfer them to a hard drive on my PC, but am unable to view most of them using QuickTime Player 7.7.4. Doesn't matter if I'm viewing them via a USB connection to my iPhone5 or from a hard drive after the file has been copied via USB.  1% of the vids are viewable, 20% open with a black screen and audio only. The rest open with a blue, purple and green stryrated mess and no audio.  Yes its a Quick Time problem I know but where do I post this question in the community?  Also searching my drives for other .MOV files downloaded from the net I find the same problem with them.

    Heres what I don't like about VLC, but at least the files are viewable...somewhat.
    1. You can't flip the image 90degrees, needs to have a rotate feature for sure.  This needs to have keyboard shortcut so vids can be rotated easily as one may have shot video horizontally and vertically in the same take.
    2. Opens file to a very large window, most of it off the screen, it should REMEMBER what you resized it to, so the next time a video is played you don't have  to drag the window back on the screen so you can get to the resizing handle in the lower corner.
    3.  Doesn't buffer while playing, so the movies are extremely erractic, starting and stopping every 3 seconds, highly annoying. 
    OK so maybe my PC is too slow, its a dual processor 486 Hyperrthread 2.8G but I only have 2Gigs of memory, however, bettery than 50% of the memory is still available while playing a vid (memory is checked every 4 seconds with a program), but I have 90-100% CPU useage going on while playing.
    Maybe I should think about a new computer.

  • Video blinks when I use quicktime player?

    When I use QuickTime PLayer to watch videos the video stops for a very little time (blinks) No matter if a movie, music video or ads.

    It is blocked due to licensing, in order to mirror it would need to break DRM copy protection and this isn't legal.

  • I keep getting this message when i try to play a movie on my imac "2010.DvdRip.Xvid {1337x}-Noir.avi" can't be opened. I'm using QuickTime Player version 10.0(118)

    I keep getting this message when i try to play a movie on my imac "2010.DvdRip.Xvid {1337x}-Noir.avi” can’t be opened. I'm using QuickTime Player version 10.0(118)

    Hold on... advice to someone downloading from 1337x !!!
    Until I saw your comment and googled the term, I had no idea that this was a "downloaded" file. I assumed the "1337x" reference was to dimensions/resolution and Noir referred to genre. (I.e., I use similar notations the differentiate files compressed for TV playback comparisons.) In any case, the advice is the same irrespective of the source.
    er, isn't it illegal to download movies ?
    Not necessarily. Thousands of movies are probably downloaded daily as legal purchases from such vendors as iTunes. Thousands more are available for free in the public domain, open source/community videos listings, and under Creative Commons Licensing. In short, there are many legal sources of downloadable content and you should not automatically jump to the conclusion that everyone is a crook.

  • How to use quicktime player

    Mavericks won't download adobe flash player so I would like to view videos using quicktime player.
    How do I make that happen?

    Have you tried downloading here, and not a pop-up? If you are running any anti-virus software make sure is off (disabled)
    http://get.adobe.com/flashplayer/
    you have to restart after.
    Also some info from Adobe
    https://forums.adobe.com/thread/1529491

  • HT3775 what should i do to use quicktime player on macbook

    Hello,
    what should i do to use quicktime player my on macbook

    There's not much that VLC won't play, and from what you say, and the Media Formats supported link that this thread begins with, it doesn't seem as if Quicktime will play them without some extra software.
    Can you link to the file(s) that won't work, or describe where they are & in what format ?.

  • Can a FaceTime session be recorded using QuickTime Player?

    Can a FaceTime video call be recorded using QuickTime Player?
    If so, are there any audio/video out-of-sync issues?

    Get this if you're on a Mac:
    http://www.imcapture.com/IMCapture-for-FaceTime/

  • Exporting to .mp4 file using QuickTime Pro

    Rather than use the Movie to iPod preset in QuickTime pro, I would like to export an .avi file to a .mp4 file using Movie to MPEG-4. I would like the resulting file to be encoded using h.264 video and to be 640 X 480. I want one file that I can include as an enclosure in the rss feed for my podcast that can be downloaded and played in both iTunes and on an iPod. So far, I have been able to create a .mp4 file that plays in iTunes/QuickTime but not on an iPod.
    Would someone with experience in this please tell me which settings to use in the MPEG-4 export settings dialogue so that I get a file that can be played on the iPod.
    The options are:
    File Format (I chose mp4)
    dropdown (I chose video)
    Video Format (I chose H.264)
    Data Rate (I know it's important that this not be too high but don't know what to put.)
    Optimize For (download is the only choice for this option)
    Image Size (I chose 640X480 VGA)
    Preserve Aspect Ratio checkbox (My original video is 720X480. I don't think I should check this. I want to change the pixel aspect ratio to square pixels.)
    using dropdown box (Letterbox, crop, fit within size) (only active when Preserve Aspect ratio is checked)
    Framerate (I chose 29.97, which is the frame rate on the original .avi file)
    Keyframe ( I set this to every 15 frames)

    Thanks. I was aware of that information. But still am stuck on using QuickTime Pro to come up with a usable .mp4 file for the iPod. I think I am using the right settings, but it's still not working. That's why I included a lot of detail about the specific options in my question. Hopefully, there's someone out there who has used QuickTime Pro for this.

  • "Always Open with" check box forces you to use quicktime player, can't change it to VLC. Any help or Apple is really trying to take over???

    When I Open an .avi movie with VLC and check the box "always open with", a dialog shows up saying that I can't change the item "...avi" to always open with the selected application. The item is either locked or damaged, or in a folder you don't have permission to modify (error code - 54)
    So in summary I can't use VLC to always open .avi files. The file is in a folder that I created in my desktop with all permissions and working perfect (not damaged) I am the admin and owner of the Laptop and file.
    The same happens when I check the box for .mov or .mp4 files but with them I don't even get the dialog box with the massage, it just opens directly with vlc and when you think it went through, I double click to open the file and it opens with quicktime. No matter how many times I check the box "Always open with" It will always open with quicktime.
    On my other laptop, an old Sony Vaio with Windows 7 I never had this kind of stress. Why does this kind of thing only happens with Apple?
    Can anyone help?

    Apple-is-**** wrote:
    can I delete this discussion?
    no.

  • Using QuickTime Player's 'Save for Web' feature in iWeb

    I'm using iWeb (3.0.3) to create a site. I've also used the QuickTime Player (10) feature "Save for Web" command to save optimized versions (for iPhone and desktop) of a clip I'm using in my site. I want to keep the nice features of the QT Save for Web, i.e., the poster frame and the nicer QT controller.
    I've managed to get everything hooked up right (using an HTML snippet in iWeb and hand-editing the page's html file to add the lines to <head> that the Save for Web's instructions specify. Yay!
    All good so far. When I view the page in Safari, the poster frame shows up perfectly. But when I click on it, Safari swaps in a new page (frameset?), which loses all the navigational stuff I have on the "real" page. The Save for Web's instruction html page doesn't do this -- why is it happening in the iWeb page? I've tried stripping stuff out of the iWeb-generated page, but no luck.
    Please help ... I've spent HOURS trying to figure this out, and I'm at my wit's end!! 
    (Additionally, if someone can tell me where I can put the 4 files that the Save for Web command creates so that iWeb doesn't wipe them everytime I publish, I would be a very happy man!! 

    This demo page has instructions on how to use that feature: #18 - Adding Movie/Video File to iWeb Page via Export for Web in Quicktime Player. 
    This demo page has an example of how it looks: Using a Movie Exported Out of Quicktime Player via “Export for Web”
    OT

  • Can I use QuickTime player to watch video in YouTube

    Can I use he QuickTime player to watch video in YouTube, I seen like YouTube use flash player

    Some DVDs and Blu-Ray movies come with a "digital copy" that allows you to download a copy of the movie for use on computers and portable devices. You might see if any of the DVDs you have come with such a feature. Walmart/Vudu also has a service that basically gives you a digital copy of a DVD you already own. See:
    http://www.vudu.com/disc_to_digital.html
    Regards

  • I am using quicktime player and i want to add a music track can anyone help me please

    I want to add a music track to my quicktime movie any help out there

    HI sjr64,
    I would suggest that you use iMovie or a similar video editing program to add a music track to your video:
    iMovie (2013): Add audio and music
    http://support.apple.com/kb/PH14708
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • Is it risky to start a online business using quicktime player?

    I am starting a business with video on the internet, but after doing my research I find that most people have the flash player on their browsers and many would have to download the 30mb+ file filling out forms etc just to view the video content on my pages. I realise that h264 video is supreme, but there is a problem if people have a hard time getting quicktime on their computers. Any advice?

    It's probably a lot more work for you, but I'd offer the content in several options. Quicktime, Flash and WMV. IMO, it's important to keep QT as part of what you offer. If everyone caves to providing only Flash or WMV, then QT will continue to be the underdog.
    I think the reality is that there are still more PC's than Macs out there, but it's a great statement for a site to offer QT along with the rest.

  • Using Quicktime Player with iTunes

    Quicktime player is duplicating videos during playback ie same video is being played twice within same screen.
    Has anyone a solution to this problem.
    Have spent a longtime online looking for solutions and have gone through both iTunes Support and Quicktime support with no luck.
    Also cannot see a solution available within any of the playback preferences for both iTunes and Quicktime.
    Thanks in advance for advice.

    I had a similar problem once, but it was duplicated audio, not video.
    I fixed it by uninstalling Quicktime, rebooting, then reinstalling Quicktime.

Maybe you are looking for