Shaunaq Posted May 30, 2002 Posted May 30, 2002 Hi, I am new to FMP, and was wondering if it is possible to make a button such that when I click on the button, a file opens up in Picture Viewer. I am new to Macintoshes too, and don't know how File paths are defined in Macs. I tried using a script for opening a file, but don't know how to specify the file path name. Also, I am using a database with thumbnails of pictures, and want a button under each thumbnail which launches a full sized picture which is in another folder. I am using FMP 5.5v2 and MAc OS 9.2 Thanx Shaunaq
kenneth2k1 Posted May 30, 2002 Posted May 30, 2002 Hello, Is it necessary to open the image in PictureViewer? Because you can open it directly in FileMaker using a container field. Then you could script a button to insert a picture in the container field. If you need different sizes, you could use different layouts with different size container fields. What do you think? Ken
Shaunaq Posted May 30, 2002 Author Posted May 30, 2002 Hi. I am really very new to FMP, and just by fooling around with it, I can kinduv figure out what you are saying, but not exactly. Maybe my question wasn't really clear. The big sized pictures we have are 200-400K each & we have 2000 of those. so to reduce the size of the database, we want to make thumbnails of these pictures, (3-5K each) and put them in the database, but also make it so that if required you can view the whole picture by clicking on a button or the thumbnail itself. These bigger images would be in a separate folder on the hard drive, and I was wondering how it was possible through FMP. If you don't mind, could you please explain the steps in detail, coz I am REALLY new to FMP. Thanx a bunch! Shaunaq
kenneth2k1 Posted May 30, 2002 Posted May 30, 2002 Sure! What I suggest is making a container field (you can make it as big or small as you want) and storing your images in it. Create a field in Define Field and specify it as a container field. Click on the field, then you can use Insert/Picture (click "Store only a reference to the file" if your pics are really big. This reduces the size of the file). I will try to help you more.
Shaunaq Posted May 31, 2002 Author Posted May 31, 2002 Well, I did make a container field, and stored an image in it as a reference. But then that didns't really solve my problem of viewing the image in full size using a single click. How do I make it so that when I click on the thumbnail or another button below it, it opens up in full size? Thanx Shaunaq
danjacoby Posted May 31, 2002 Posted May 31, 2002 Two layouts -- one to show thumbnails, one showing the full size pic. In the full size pic layout, the container field is large enough to show the entire picture. In the thumbnails layout, the container field (the same field!) is much smaller -- go to Format:Graphic and make sure "Reduce" is selected, and the box to maintain proportions is checked. That way, you only import one picture -- the full-sized one, but see it in both thumbnail and full sizes in the two layouts. Script the container field in the thumbnail layout to go to the full size layout.
meancode Posted June 4, 2002 Posted June 4, 2002 if you want to open the image in an external app such as PictureViewer or Photoshop, you will need one more field (text), and use the Send Apple Event script step. the field you will need will store the file path to the image. on the mac, you use colons, :, not slashes such as unix or windows uses as the directory deliminator. so if your files are on the desktop, in a folder called images, your path would be: NameOfHD:Desktop Folder:Images:image1.jpg. now its not so fun to have to copy/paste/type the directory path of those images. to automate this process you can use AppleScript. here is a script i found that Matt Petrowsky (ISO Productions) wrote. i have used it in the past. i now use a plugin called Troi File Plug-in, but since you are new to FMP, i dont want to confuse you even more that you already are (that and plug-ins cost money, and this is free). i hope the words Apple Events and AppleScript does not set you glued to the ceiling, he he. if you are more akin to Windows, Apple Events are sorta like Send Message, and AppleScript is sorta like DDE. anyway, here is the script. ------------------------------------ property theDatabase : "CD_INDEX.FP3" property theField : "CD Path" property newRecord : "No" on open (theFile) -- the following displays are to test that the properties are getting transfered from the setting Applet --display dialog theDatabase --display dialog theField --display dialog newRecord tell application "FileMaker Pro" if newRecord = "Yes" then set x to ID of (create new record at database theDatabase) go to record ID x set data of cell named theField of record ID x of database theDatabase to theFile as text else set data of cell named theField of current record of database theDatabase to theFile as text end if activate do script FileMaker script named "Next Record" end tell quit end open ------------------------------------ open Script Editor (it should be in Applications (Mac OS 9):Apple Extras:AppleScript), create a new script, and paste this script in the main window. now you need to change the Properties, the first 3 lines of the script. if you set newRecord to "Yes" it will create a new record every time this Applet is run, if not, it will just populate the field in the current record. so set the name of your database, and the name of the new field you just created in Define Fields. when you have these 3 things changed, go to File, Save, and select Classic Applet as the Format, also make sure Never show startup screen is checked, and Stay open is unchecked. then give it a good name, and you are done. now whenever you drag one of your images onto this applet, it will populate the field in FMP with the path. the line of AppleScript code that reads: do script FileMaker script named "Next Record" refers to a ScriptMaker script you have setup in FileMaker. so if you would want to do something else to this record, this is were you could automate that as well. just rename Next Record to whatever the name of your script is. if you do not have a script or want to run a script after the AppleScript is done, you will want to take out the Activate, and that line of code. if you do not you will get an AppleScript error "Object cannot be found." ok we are more than half way done. create a script that you wil attatch to a button. use the Send Apple Event script step (its at the very bottom of the list). choose Open Document from the Send the pop up click the field value radio button and select the Path field you created click the Bring target app to front check box click Specify Application, and go find the app you want to open the image. asign the script to a button on the layout, and you should be good to go.
Shaunaq Posted June 6, 2002 Author Posted June 6, 2002 Wow! Thank you so much. I hope I had read you post before, but someobdy introduced me to TROI FIle plug-in. & I used it for this project.. Thanx a lot though..
LiveOak Posted June 7, 2002 Posted June 7, 2002 We have done a large photo database for a client and I would recommend a two step approach. 1) Use the Troi File plug-in to import a thumbnail (reduced size) image directly into a container field in FM. 2) Import a reference (not the actual picture, FM file will get very large and slow very fast) to the full sized photo into another container field. 3) Put the two fields on different layouts and switch between the layouts to "Zoom". I can't stress enough that the Troi File plug-in has been absolutely invaluable in managing large numbers of images. It allows the automation of copying picuture files from a CD to a network volume, creating thumbnails, and importing references to images in a "batch" mode. It allows you to find/create/manage file paths and it is cross platform. -bd
Recommended Posts
This topic is 8210 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 accountSign in
Already have an account? Sign in here.
Sign In Now