Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Script to open QuickTime Video


Videotom

Recommended Posts

Greetings,

 

I'm a long-time Filemaker Pro user (15 years now), but still a novice in terms of how to script things.

 

I've created this database to help me manage a TV series that we're editing from existing episodes (it's called a "Clip Series").

 

I have a container field that we've pasted into, references to the 78 QuickTime episodes we are working with (they're small versions of the episodes). They show-up and play just fine within the layout in Filemaker Pro. All of the actual movie files are in the same folder on the same hard drive. I also have a field that lists the name of the quicktime file. For Example: "Episode E203.mov"

 

However, I need to be able to quickly open the movies IN Quick Time 7. My thought was to have a button next to the movie that : 1. pulled or figured out the pathname, and 2. launched and opened the movie in QuickTime 7. I've found this applescript online:

 

-----------------------

 

set filePath to (the clipboard)

 

tell application "Microsoft Word"

activate

open (file filePath)

end tell

 

------------------------

 

The issue is that I don't really know how best to determine, then integrate the filePath. Ideally, the script would pull the filepath from the Container field containing the link to the QuickTime file. But I have no ideas how to do this, and how also to integrate FilePath with Applescript.

 

Any suggestions or advice would be well appreciated,

 

Tom

Link to comment
Share on other sites

GetAsText (containerfield) will return the path of a movie that has been inserted into a container field using "Insert QuickTime".

 

(also works with files or images if they are stored as a reference).

 

GetAsText (container field) should give you multiple separate lines of text when the file (movie, picture, whatever) is stored as a reference. (And movies always are when inserted using "Insert QuickTime").

 

You want the last of those values, so

 

Let (ctrtext = GetAsText (YourContainerfield); RightValues (ctrtext; 1) )

 

gives you the stored path, which in the case of an inserted QuickTime movie will be something like

 

 

moviemac:/YourFileServer/Movies/Project One/Example.mov

 

To tell QuickTime 7 to open that, you can create a calculation field of result type "container" defined as the substitution in that string of "moviemac" with "filemac". This results in a FILE stored as a reference and if QuickTime 7 Player is your default application for opening files of that file type, double-clicking the calculation field will open the file in QuickTime 7 the same as double-clicking the actual movie file on the hard drive would do.

 

 

Hence:

 

Let (

[ctrtext = GetAsText (YourContainerfield);

pathtext = RightValues (ctrtext; 1) ];

 

Substitute (pathtext; "moviemac"; "filemac")

)

 

 

... is the formula for your calculation field.

 

Define that field, put it on your layout, and double-click it. (Obviously use your real container field name, not "YourContainerField").

Link to comment
Share on other sites

  • 10 months later...
GetAsText (containerfield) will return the path of a movie that has been inserted into a container field using "Insert QuickTime".

 

(also works with files or images if they are stored as a reference).

 

GetAsText (container field) should give you multiple separate lines of text when the file (movie, picture, whatever) is stored as a reference. (And movies always are when inserted using "Insert QuickTime").

 

You want the last of those values, so

 

Let (ctrtext = GetAsText (YourContainerfield); RightValues (ctrtext; 1) )

 

gives you the stored path, which in the case of an inserted QuickTime movie will be something like

 

 

moviemac:/YourFileServer/Movies/Project One/Example.mov

 

To tell QuickTime 7 to open that, you can create a calculation field of result type "container" defined as the substitution in that string of "moviemac" with "filemac". This results in a FILE stored as a reference and if QuickTime 7 Player is your default application for opening files of that file type, double-clicking the calculation field will open the file in QuickTime 7 the same as double-clicking the actual movie file on the hard drive would do.

 

 

Hence:

 

Let (

[ctrtext = GetAsText (YourContainerfield);

pathtext = RightValues (ctrtext; 1) ];

 

Substitute (pathtext; "moviemac"; "filemac")

)

 

 

... is the formula for your calculation field.

 

Define that field, put it on your layout, and double-click it. (Obviously use your real container field name, not "YourContainerField").

 

Hello,

Not sure why, but your script is creating an additional ":" after the Volumes name in the path so it looks like file:///Volumes/:/PROJ/Jobs/ ...

There shouldn't bee the ":" between Volumes/ and PROJ/ in my path. Please advise ASAP. Thanks for your help!

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use