Jump to content

Applescript and Automator


alex4478
 Share

1 post in this topic

Recommended Posts

Hi,

 

I tried to post this in the Applescript/Automator forum, but as it's my first post could only post it here.

 

I've created an Automator (AM) script that uses an Applescript (AS) inside it but when the AM script runs all the steps are performed including the AS portion, but the AM script stops at the end of the AS step without carrying on to the next step in the AM script. Incidentally the AS script does require the program carrying out the work to quit, which it does not do.

 

Above is a summary of the problem, below is more information and the troubled AS script.

 

I'm trying to convert a .mov file to .mp4 using Visualhub and AM, but a step in my AM file uses an AS step that just causes the AM flow to stop and the end and not go one with the rest of the actions.

 

More specifically:-

 

1. I use my HD camera to film something.

2. Connect the camera to my mac.

3. Import the video using iMovie.

4. My AS actions ask me to confirm that iMovie has finished the import

5. Then Ask for finder items, which is get the newly imported .mov into VisualHub

6. Run the problematic AS:-

 

on run {input, parameters}

--we need to unset the default timeout length of two minutes, we'll make it 45

with timeout of (45 * 60) seconds

 

tell application "VisualHub" to set VisualHub to load script (scripts path of main bundle & "/automation.scpt" as POSIX file)

 

tell VisualHub

LoadSettings("/Volumes/MyBook/hd.cam.settings.vhub")

--SetSaveLocation("YOURHARDDRIVE:Users:YOURNAME:Desktop:iphonemovies:temp")

AddFiles(input)

StartConversion()

QuitApp()

end tell

end timeout

return input

--delay 15

end run

 

Which I've used from this site (http://professafresh.wordpress.com/2007/10...with-automator/) and just stopped the two lines with a comment marker.

 

What is supposed to happen after that is that

 

7. AM asks to confirm that VisualHub has finished.

8. VisualHub quits

9. Finder finds the .mov that was created when the film was imported

10. Finder then moves the item to the trash.

 

So there is something going on with the AS that causes the process to stop after the conversion.

 

Some points:-

 

1. I have used the VisualHub import and convert script step but the default settings are not what I'm after as I want the video resized to 960x540.

2. iMovie recognizes and keeps all the head info as long as the file name is the same. So if you skip over the thumbnail in iMovie the timestamp changes to reflect the time that the video was taken. If you convert the .mov to .mp4 the info is retained but with a much smaller video size.

 

I've tried to give as much info as possible, sorry if it's too much.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...