Jump to content
Sign in to follow this  
BobWeaver

Applescript Funtime! Motor Racing and TV

Recommended Posts

I would use Applescript to transfer (cut and paste) the graphics directly from Filemaker to Photoshop (er... is Photoshop scriptable?) to do the cleanup and then have photoshop save the final file. Applescript could do the final file renaming if necessary.

Filemaker has just enough Applescript capabilities to lure you into thinking that you can do anything without too much trouble. Then suddenly everything falls apart. I've had some trouble trying to manipulate any data that cannot be treated as text.

Share this post


Link to post
Share on other sites

Here is a neat trick in FMP 4 (should also work in FMP 5 but have not verufied it)???

Change into preveiw mode, perform a "copy" command. An image of the current layout is now on the clipboard. Paste it into a container field and voila!

So, design a layout to accommodate the data then make a script that changes into preview, copy, change to browse mode, paste into container field.

Share this post


Link to post
Share on other sites

I've got lap-by-lap results for 80 laps of a motor race in Filemaker. I need to use these to generate TV graphics. The results I need are displayed in a portal in a database with 80 entries, each of these corresponding to a lap of the race (ie record 1 is lap 1 thru record 80 is lap 80).

Some issues here, and ideas I've had:

1. Can I get filemaker to export the portal as a graphic, and name it?

2. I suspect not. In this case, I'm going to need an AppleScript to coordinate with Filemaker, so that Filemaker runs sequentially through the records/lap no's and AppleScript takes a screen grab of the window at every iteration.

3. This will result in Picture 1 through Picture 80 in the root of my boot disk.

4. AppleScript renames these to something like 01_monza, 02_monza etc (potential caveat: the finder will not have the pictures in the right order ("Picture 10" comes before "Picture 2" alphabetically, I need to make sure it sorts on creation date).

5. AppleScript opens these in Photoshop, where I've written a Photoshop script to trim off spurious areas of the picture (eg window title bar), resize the image and apply the necessary video filters.

6. Photoshop can resave the images. It could also rename them, but it's probably better to do this while they're still in the finder, in case they get mixed up later.

What do you think? Sound feasible? And does anyone have any AppleScript advice for this problem? I'm very comfortable in Filemaker and Photoshop but the sum total of my AppleScript experience would be about 15 mins.

PS. MacOS 9.1, Filemaker 5 and Photoshop 6, if that's any help.

Share this post


Link to post
Share on other sites

Thanks Vaughan, that's a very cool trick.

Bobweaver, Photoshop 6 is scriptable, but not as much as I thought it would be. This from its help file:

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

quote:

AppleScript Commands with Photoshop 5.0 or 4.0.x

Photoshop 5.0 or 4.0x for the Mac OS is compatible with the following AppleScript commands. To automate tasks in Photoshop, use the corresponding command.

Photoshop Function

AppleScript Command

Description

Open a file

open

Open the specified object(s).

Print

print

Print the specified object(s).

Quit Photoshop

quit

Quit the application.

Start Photoshop

run

Sends the script to an application when it is double-clicked.

Run an existing Action

do script

Plays the specified Action. Enter the name as it appears in the Actions palette.

AppleScript does not have a Batch command, and you cannot access Photoshop's Batch command using AppleScript. The Photoshop User Guide makes reference to Photoshop batch process files. This is not a reference to Photoshop's Batch command. Instead, you can use AppleScript's Repeat command (as shown in sample 2 for Photoshop 5.0 and 4.0.x, below) to process a batch of files.

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

Something tells me the tabs will get lost when I post this, the page is at <http://www.adobe.com/support/techdocs/2b42.htm>.

The main problem I'm having is how to get the graphics out of Filemaker, after I've done the preview/container field trick that Vaughan recommended.

If I can get all the files in a folder, with a name that correspondes to the record/lap no (eg pic_01, pic_02 ... pic_80) I can process them in photoshop no problem, that's a separate issue really.

But how to get the graphics out of Filemaker? They're in container fields, and they need to somehow export and title themselves.

Could I use any third party app to open the FM database and extract the images in that way? How does FM store the images?

Share this post


Link to post
Share on other sites

Get a copy of GraphicConverter from:

http://www.lemkesoft.com

It is very scriptable and can create a new graphic document file from the clipboard. You should be able to make an applescript that copies from the container field in filemaker to the clipboard, and also sets an applescript variable to a file name from a filemaker field (such as "01_monza.jpg" etc.), and then commands graphicConverter to create and save the document. You might even be able to do all the cropping and other editing right in GraphicConverter. It has a lot of scripting capabilities.

Share this post


Link to post
Share on other sites

Thanks Bob, I downloaded Graphic Converter and the ExportFM plugin. I'm going to check them out over the next few days, it looks like either will provide a good solution.

I'll probably go with ExportFM, if only because it will be quicker than learning GraphicConverter (although GraphicConverter is being carbonised, which looks pretty sweet if it comes out before carbon Photoshop).

I'll come back and let you know how I got on. Thanks for your help, it's been invaluable.

Share this post


Link to post
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
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.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    cfmartinez1090 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.