Adding meta-data to quicktime files

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

November 29th, 2004, 7:01 am

Does anyone know of a way to write data into a quicktime file like, Author and copyright etc... ? I would like to be able to do this with scripting. I was wondering if you could accomplish this with AppleScript and maybe call the AppleScript from within AE?
User avatar
Disciple
Posts: 137
Joined: June 5th, 2004, 8:05 am
Location: Los Angeles, CA
Contact:

November 29th, 2004, 9:27 am

Byron
Check this page out :
http://www.apple.com/applescript/quicktime/

You might find some useful info in one of the scripts you can download there.
Then to run the applescript I guess you could find inspiration in Impudent's script to render and shutdown, more specifically the following lines :

// osx sh file
var exe_shutoff = new File("shutoff.sh");
exe_shutoff.open("w");
exe_shutoff.writeln("#!/bin/sh");
exe_shutoff.writeln("shutdown -h now");
exe_shutoff.writeln("rm shutoff.sh");
exe_shutoff.close();
exe_shutoff.execute();


Alex
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

November 29th, 2004, 11:21 am

Yeah, I found some good info on the Apple site after I posted that. They have some applescripts that add annotations to quicktimes. I've never used Applescript since I'm on a PC but I'm going to see if I can get it to work on one of the Macs here. I also found this.
"The MacOS.OSA object allows you to invoke other OSA scripting languages, such as AppleScript or Fronter, directly from within JavaScript."

MacOS.OSA.AppleScript //constructor Specify the language you want to use:
MacOS.OSA.execute() //execute the script and return the value produced by the script

I wonder if AE can use those commands?
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

January 26th, 2005, 3:36 pm

I've been working on this script for a bit now. I am trying to get AE to write and run an Applescript. This is my script to test the ability to write and launch an applescript from AE:

{
var exe_shutoff = new File("TestAE_IO.scpt");
exe_shutoff.open("w");
exe_shutoff.writeln("open location 'http://www.armoredsquirrel.com'");
exe_shutoff.close();
exe_shutoff.execute();
}

When I run it I get this error: "Can't Import File "TESTAE_IO.scpt": unsupported filetype or extension"
Anyone have any ideas?
User avatar
Disciple
Posts: 137
Joined: June 5th, 2004, 8:05 am
Location: Los Angeles, CA
Contact:

January 27th, 2005, 10:35 am

Byron, it seems there is an issue with file creator. As the .scpt file is created by AE, the mac probably thinks it has to open it with AE, which can't be done.
You need to get info on a .scpt file and make sure you choose "open with" After Effects and Change All so that all .scpt files are opened by the apple script editor.

However this won't get you out of trouble, as the Script Editor won't run your script, it will only open it.

Now if you want AE to run the script, I think you need to make AE execute the script, but that is slightly tricky as I don't think AE has a very extensive applescript library, and I have no idea how AE can actually run a script.

Alex
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

January 27th, 2005, 11:29 am

When you say "I don't think AE has a very extensive applescript library", do you mean AE needs actual applescript commands? Looks like people are having a similar problem getting .sh files to run from AE too from what I saw on anoher post? If we could get anything to run, I guess we could piggyback scripts until something could execute applescript.
User avatar
Disciple
Posts: 137
Joined: June 5th, 2004, 8:05 am
Location: Los Angeles, CA
Contact:

January 27th, 2005, 12:47 pm

In fact, the problem is a bit more complex than I thought. I found out that you can in fact execute a script from an applescript (use applescript to tell AE to execute an AE script), but not the contrary. Applescript can't really talk to AE (an applescript library, if I'm not mistaken, is the amount of commands applescript can send to an application), except to tell it to launch a script.

So basically for the moment there is nothing really we can do. The problem with the .sh file thing is due to the fact that as AE created the .sh file, the finder thinks AE is the creator thus the app to use to launch the file. If you can change the creator type, the terminal should open.


Alex
Impudent1
Posts: 57
Joined: June 12th, 2004, 6:40 pm

January 27th, 2005, 1:11 pm

hmmm so if I understand this correctly. Anytime mac AE generates an executable file. It gives it a filetype code. That filetype code over rides the actual osx application association when the system runs it.

ah yes a quick google on filetype codes shows this huge, a mac trojan :P

It seems to me that the problem lies in the old style resource fork conflicting/overruling the osx association.

Sooooooo, is there any way on the mac to have the script write the text file, close it, have the script then call/run an applescript that will stuffit/unstuffit the text file(that should strip the resource fork no?). Then finally let the script run the resaved stripped .sh file?
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

January 27th, 2005, 1:29 pm

I doubt it, because you get the same problem with applescript. It doesn't seems to want to run from inside AE. You get the same error that you get with the .sh file.

I wonder if you can have applescript watch a folder or individual file and do the operation Impudent just described? That way AE would plop a file down and applescript would already be waiting on it. I dont know enough about applescript to know if that is possible.
User avatar
Disciple
Posts: 137
Joined: June 5th, 2004, 8:05 am
Location: Los Angeles, CA
Contact:

January 27th, 2005, 1:35 pm

Hmm, I just found an interesting thread about an idea like that here :
http://bbs.applescript.net/viewtopic.php?p=35813

I'm a bit too burned today, but will see if I can adapt this to our problem tomorrow.

Alex
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

January 27th, 2005, 1:53 pm

If the problem is only with the creator or file type, I believe that can be explicitly set with File.open() when the script file is being created. For example:

Code: Select all

<File>.open("w", "ttxt", "aplt");
Perhaps that would do the trick of getting applescript to execute the file.

By the way, Impudent, I'm curious as to where you discovered the existence of File.execute(). I have only seen this in the PS scripting documentation.

Peter
Impudent1
Posts: 57
Joined: June 12th, 2004, 6:40 pm

January 29th, 2005, 6:36 pm

I honestly could not tell you. I am sure it was in an email somewhere in response to a question to adobe techs.

Thats the great part of this site, being able to see those hidden or oh thats why things :)
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

February 1st, 2005, 9:38 am

vidpat, where did you find those options for open()? I looked through my O'Reilly book but there's not much useful info in there.
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

February 1st, 2005, 1:38 pm

The extra arguments for open() are for AE's File object. In the AE Scripting Guide, the second and third arguments are optional "type" and "creator" codes (only honored on the Mac, of course).

Peter
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

February 1st, 2005, 2:30 pm

I found a small applescript that tells you the filetype and creator. The .scpt files are Creator: ToyS, and the filetype: osas.

I'm going to try to put those in my test script and see if that works.

On another note. I found some applescripts in the "folder actions" category that run a script when something is dropped into a folder. It's along the lines of the link Disciple put on here last week. Maybe those can help.
Post Reply