Jump to content

This topic is 7476 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I still don't know if Troi can do it. Anyone? ImageScan explicitly says it can. And it has added features for renaming and moving files, so you would not need Troi also, for this task anyway.

Here's a quick example using AppleScript. It does however require a free Scripting Addition, GraphicsImporter, found at:

http://www.macscripter.net

It could probably also be done with just the Mac OS X built-in app Image Events. But life is too short to try it right now. GI can do it all in one step, though it seems to only be happy outputting JPEGs. This was done in FileMaker 6, but should work in 7:

tell application "FileMaker Pro"

activate

tell current record of document 1

set txtPath to cell "thePath"

set thePath to txtPath as file specification

set imageCell to cell "theImage"

set theImage to giconvert imageCell type "JPEG" image thePath

-- requires GraphicsImporter OSAX

-- set theImage to giconvert imageCell image thePath -- creates PICT file, huge

-- doesn't seem to work for "GIFf" or "PDF ", but will do them as JPEG

end tell

end tell

Posted

Do you mean this???

Graphic Converter updates to 5.2

GraphicConverter is an excellent all-purpose image editing program that can import 175 different graphic-based formats, edit the image, and export it out of 75 file available file formats. The high-end editing tools are perfect for graphic manipulation as well as the ability to use Photoshop-compatible plug-ins. It offers batch-conversion capabilities, a slide show window, and so much more. A System 7.5 version is also available. Note: Version 4.5 was a paid upgrade for owners of previous versions. Once upgraded, you won't have to pay for another upgrade for the next 10 years, according to Lemke Software.

http://macscripter.net/news.php?id=4949_0_5_0_C

never mind... I found it.... http://osaxen.com/graphicsimporter.html

Posted

Remember that a regular Mac file path (as opposed to UNIX POSIX path) looks like this:

Macintosh HD:Users:fej:Documents:Documents_ll:Downloads:Candidate.zip

Where "fej" is the short user name. You can also get the Desktop for any user with:

set theDesk to (path to desktop) as string

In my case: "Macintosh HD:Users:fej:Desktop:"

And do go get the GraphicsImporter OSAX, Scripting Addition. It won't work without it.

Put it in a Scripting Additions folder in your user folder Library folder. Or put it in the System/Library/Scripting Additions.

Posted

Hi Fenton,

Help educate me once again.

frown.gif

I downloaded the upgrade of Graphic Converter and the AS Edition as you posted. However, when I insert your script my Sample file and Use the Script Step "Perform AppleScript" I'm getting this error

FileMaker Pro got an error: Object not found.

(Error -1728).

I know that it's something I'm not understanding. Maybe you can describe in simple terms what I need to do.

I have two fields.

Name (text)

Image (container)

I have the FM file on my Finder Level.

frown.gif

TIA

Lee

Posted

I would not use RightWords. Try this:

Let ( info = GetAsText(PictAsRef);

Right ( info; Length(info) - Position ( info ; "/" ; 1 ; PatternCount(info; "/") ))

)

Can you guys be so kind and walk me thru this???

I loaded this XP file onto my MAC w/ OS X and FMP7. i loaded the scripting addition... but, uh... now what? do I go into the Scripts menu and type this stuff... like NEW SCRIPT and then one of your scripts... but what happens with a scripts output then : It takes an awful long time. the file is ~ 250mb with ~ 1500 records.

Posted

You wrote this... I was wondering if you can lend a little insight. I see you are in SJ. i am local.

My drive and FMP seem like they are doing something but it's been nearly 2 hours now, which I think is probably ridiculous. This is an iMac (500mhz) w/ I think 512 RAM. not a dream machine, i know. I have 2 3ghz PCs. ACK... help

Thanks-

Eric

RightWords( MiddleValues( GetAsText(container); 2; 1 ); 1 )

http://www.fmforums.com/threads/showflat.php?Cat=0&Number=107071&an=0&page=0#107071

Posted

You are entering the "programming zone." It can be ugly (right now I'm trying to send/display CSS formatted HTML email with SMTPit, and can't get Eudora to display it how it should; and it has to work perfectly with MS Outlook; we all have our little problems).

First, for Lee. I never said Graphic Converter. I said GraphicsImporter OSAX, Scripting Addition, at:

http://osaxen.com/graphicsimporter.html

It is available the same for OS 9.

The big problem with getting images out of container fields is that they have to exist in "limbo," after coming out, before becoming a file. Only some programs can deal with this; the above GI OSAX, and the OS X app Image Events; perhaps others. Many graphic apps would let you transfer via the clipboard; copy in FileMaker, then get the clipboard. But that's indirect and a bit clunky.

"FileMaker Pro got an error: Object not found.

(Error -1728)"

This usually means just what it says. Either the field is not on the layout, or you're not on the layout, or there's no records, or some such glitch.

It's often best to test by pasting AppleScript into Script Editor first, surrounding it with:

tell application "FileMaker Pro"

script stuff

end tell

It's slower, but it will highlight the place where the error occurred. FileMaker just tells you the error, but not where it happened.

Then, when it works, copy/paste the inner script into FileMaker Perform AppleScript step, where it will run mucho faster.

Remix: I'm afraid you're "barking up the wrong tree." You CAN'T get the name of the FILE from an embedded container, 'cause there is no file; that's the nature of embedding that way.

You'll have to get the name (for the file you're going to create I assume from another FileMaker field. In my example AppleScript "thePath" would be the entire file path for the new file; which would have the new unique name at the end, but the rest would be a common folder path.

You might want to try this first on a test file, with just a few records. And, as I told Lee, run the AppleScript from Script Editor, until you're sure it works. It takes me a few tries (at least) to get these things to work. It's crazy to try on a large file. It's going to be slow even when it works right. It will run much faster in an AppleScript step; but wait 'til you're sure it works first. Look carefully at your filepaths, that's the mostly likely error point, once you have the GI OSAX in place.

Posted

Hmmm... I thought it could pull out the original file name... it doesn't need to be tho.

I am down to have anything. each record has a unique ID # and most also have model #s.

Again, what I need are the images exported w/ a unique filename and that name in text so I can link to it...

Remix: I'm afraid you're "barking up the wrong tree." You CAN'T get the name of the FILE from an embedded container, 'cause there is no file; that's the nature of embedding that way.

You'll have to get the name (for the file you're going to create I assume from another FileMaker field. In my example AppleScript "thePath" would be the entire file path for the new file; which would have the new unique name at the end, but the rest would be a common folder path.

You might want to try this first on a test file, with just a few records. And, as I told Lee, run the AppleScript from Script Editor, until you're sure it works. It takes me a few tries (at least) to get these things to work. It's crazy to try on a large file. It's going to be slow even when it works right. It will run much faster in an AppleScript step; but wait 'til you're sure it works first. Look carefully at your filepaths, that's the mostly likely error point, once you have the GI OSAX in place.

Posted

There is no original file name. When you completely embed a picture in that way, it's similar to copy/pasting. The receiving application keeps no record of where it came from.

So, you have unique names. Just create a calculation which will produce a valid filepath, to a folder you've created (as I said, the Desktop is the easiest place to start). If I have a NewImages folder on my desktop, the common folder path would look like:

"Macintosh HD:Users:fej:Desktop:NewImages:"

That can go into a Text global field.

Add on whatever name you want for your picture. It's probably best to do this in a FileMaker calculation first, so you can see the result on a layout.

The final result could be grabbed by AppleScript as that "cell" (see my AppleScript).

I could work up a little example I suppose. I'm kind of behind here, writing a FileMaker email solution, hence not excruciating helpful :-|

Posted

thanks for the input, yet again... i'll tackle this now, while it is cooler

good luck with your email thing, you've been a big help... hopefully I won't need you to write it... but... ya never know. smile.gif I'm down to even just export while I am on my PC w/ on of those plug ins... and do the names on the MAC... I think it can do that... although not ideal.

Posted

ON A MISSION!

Basically want I NEED this to do is I suppose...

Select 'Image' container field

Copy 'Image' to Clipboard

Open a program, say Fireworks

paste 'Image' in Fireworks

save as [unique filemaker record#].jpg

close fireworks file (not Firework program)

add [unique Filemaker record#].jpg filename to a field in Filemaker so program can reference file... in my case, say "proaudioimages/"

Note: I no longer have the images saved on my drive (don't even ask)... that's why I need to find a way to export these images.

Maybe this will help a little more...

screenshot057.jpg

screenshot058.jpg

What would it take for someone to like handle this for me?? you know... 1 record or 1,000 records... it's the same. Someone who has this down can surely do it with ease... this, I have found, is not me... but I'll keep trying

Posted

You wrote this... I was wondering if you can lend a little insight.

RightWords( MiddleValues( GetAsText(container); 2; 1 ); 1 )

The GetAsText() thing only works with image references, while you have the images stored in the database. I suspect Fenton's AppleScripting ability is what is needed to fix this.

Posted

Hi Lee,

You can always copy the picture into the clibpoard (it will convert into a PICT resource), and then write out a PICT file with this litte script:

on error -- must be an embedded image

set theImageName to "Pasted PICT"

end try

set thePICTdata to (copy cell "image" as picture

set thePICTfile to (choose file name default name theImageName)

set theFileReference to open for access thePICTfile with write permission

set eof theFileReference to 512 -- 512 bytes for Data Fork PICTs, usually MacDraw info etc

write thePICTdata starting at 513 to theFileReference as picture

close access theFileReference

tell application "Graphic Converter"

open thePICTfile ...

...

here comes the conversion code

Posted

Hi Christian,

Good to see you back, where have you been for so long?

Thanks for the AS, I tried it out just now, but i'm getting some errors. I see you are using OSX, so I thought I had better make sure it is for OS 9.x before going any further. confused.gif

Thanks again,

Lee

cool.gif

This topic is 7476 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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