Scripted Button to Open Referenced Object (jpeg picture)

I am creating a database that also points to stored jpeg files on another server.

I've Inserted an Object Link to the picture and when I double click on the image; the picture opens completely in the local picture viewer just fine.

Now I'm trying to get a scripted button that when the user presses, that action takes place automatically.

What command in a script will mimic the double clicking of the object?  If i right click on the object, I see a menu choice of "Activate Contents Linked Package" that does the same thing.

When finished, this database itself will be hosted on a FileMaker Server and will need to work the same for all users.

These are Windows 2000 and XP machines.

Thanks,
Joe
jtflexAsked:
Who is Participating?
 
lesouefCommented:
yes, you did, but I did not read that far!
no this method won't work under v6.
the only thing you can do under v6 is "import records from a folder": it will import the image (linked or embedded, plus filename and/or path), but the folder to import from must in the script command, so forget about browsing it. To browse, file/import from folder manually.
to open the image, create a field where you store the path, and right click on the filepath/name, that will open the default app for this extension.
if the file is to be placed on a server, male sure the path is true for all users, ie same logical drive, or use a UNC path //server/folder/etc...
the plug-in could work with this, but fm6 can't do anything from a path in a field, so useless...
example: https://filedb.experts-exchange.com/incoming/ee-stuff/4932-insert_picture_fm_folder.zip
0
 
jvaldesCommented:
Yo actually don't need a script, Choose the button you to use and assign the command

OPEN URL "file://"&Right ( Document Path ; Length ( Document Path )-2)

where Document Path = "the windows path to your file"

The command you are passing to the OPEN URL command should be "file://servername/path/filename.jpg"
0
 
lesouefCommented:
The problem is just to get this path in a field at import time.
If you import them 1 by one in a text field, you just get the file name, but if they are all stored in the same folder, you can work out the complete path by concatenating path + name.
If you use batch import, filemaker is able to get the complete path to a field, in which case it is a lot easier.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
lesouefCommented:
The easiest is maybe to use the web viewer, this way you don't even have to click, put the file path in a field and use a web viewer object using this field as ref, it will display in the filemaker layout.
0
 
jtflexAuthor Commented:
Thanks for the responses.  I was hoping that since it's a linked object, it's path in stored in FileMaker and accesable through a command.

I have used the Send URL command in another Database and don't mind using that as the solution.  However, I wanted to automatic as much as possible for the user who is always adding new data and photos to this database.  The photos are stored on a different server in different folders as new pictures are being posted.

Currently I have a scrpit that uses the "Insert Object" window.  The user then has to navigate to the storage location for the photo to link to.

Is there a way to capture the path while the user is selecting the picture to link to?

Thanks,
Joe
0
 
lesouefCommented:
the filename only, not the path unfortunately...
you need a plug-in to capture it. Troi file or File Toolbox (the latter is an old fm6 style extension, but free).
The Troi does more things.
but what about batch importing them? that provides the path, but you will import all images of a given folder at once.
0
 
jvaldesCommented:
I use a vbscript to inventory the files and the paths as well as any document properties that are present and save them to an excel file which I then import. If you would like that code please let me know and I will send it...

We use it to access over 13500 files of various formats. pdf, dwg,doc,jpg, etc. The script runs as a sceduled task on our file server then the import is a scheduled task for filemaker.
0
 
jtflexAuthor Commented:
Hi lesouef and jvaldes;
I looked at the plug-ins and diffenately the Troi one would do what I asking.  However, the license agreement makes it too costly for us as we have around 500 computers that may access this database when it's done.

I like your script jvaldes and wouldn't mind using it for a different application I have.  

I guess the only real issue I have to solve is capturing the file location from the open window command (much like the Troi plug-in does).  If either of you have a vb script or know where I can find one please let me know.  I'll research it today also and let you know how I solve this.

Thanks again for working with me on this issue.

Joe
0
 
lesouefCommented:
the protolight filetoolbox plug-in is able to get the path/file from the file choose dialog too, so if this is the only thing you need, give it a try, it's free. be care, it's got no mac version if you'd need it.
0
 
jtflexAuthor Commented:
Thanks lesouef.

I didn't realize when I first downloaded the filetoolbox plug-in they had a beta version that does this.  That will work for me.  It looks like the user will still have two things to do:

First they will have a script where they open an "insert picture" command, find the image and link to it.
Then they will have a second script where I use the plug-in; they find the image again and capture the path\file name.

Is that what you were thinking also?  Do you think the two can be combinded would work together?  It looks like each one opens it's own window for selecting the file.

Any rate if that can't be comined this is still probably the solution.

thanks,

Joe
0
 
lesouefCommented:
no, it should be done in a single step as far as the user is concerned
select the file to get the path, and have filemaker to insert the picture using the path.
let me check if this work...
it does, but there is a trick, 2 in fact.
- you must work out the file path given by the plug-in to reformat it filemaker like
 (c:\tmp\image.jpg > image:/C:/tmp/image.jpg )
- define a variable $file = image:/C:/tmp/image.jpg
- use that as the fileref (fields are not accepted as filerefs but variables yes)
- goto field [image_field]
- insert $file
(tested)
0
 
jtflexAuthor Commented:
Are file variables allowed in Filemaker 6?  I've never used variables in Filemaker.

It looks like an excellent solution though.

Joe
0
 
lesouefCommented:
yes. I can write an example tonight if you like.
0
 
jtflexAuthor Commented:
Yes, that would be terrific if you could spend the time to do so.  I'm slowly learning more about Filemaker and I see where I could use variables for some other projects.

You're a great assest to this forum.

Joe
0
 
lesouefCommented:
the example.
https://filedb.experts-exchange.com/incoming/ee-stuff/4929-insert_picture_fm_name.zip
don't forget to install the plug-in, if you don't, my startup script will warn you that's it's missing. safer to do it this way, when you use files on many machines.
0
 
lesouefCommented:
forgot to mention that you should change the 'link only' field for a global one, there is no need to have it specific of each record, since it just determines how you will insert the current picture
0
 
jtflexAuthor Commented:
Hi lesouef,

Sorry to be a pain, I think I mentioned we're using FileMaker 6.  This is a FileMaker 7 script and it won't open.  If I find a copy of FileMaker 7 will I be able to see the script and use in in FM6?

Once again, sorry for the trouble I'm giving you on this.

Joe
0
 
jtflexAuthor Commented:
Thanks,

I think this method will work fine.

You've been a big help to include me seeing if the higer-ups for us might want to upgrade FileMaker if they plan to continue building new databases.

Thanks again,

Joe
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.