Wickerman Posted April 21, 2012 Posted April 21, 2012 Is there a way to rename an image file that is held in a container field - in either FM 11 or 12? I'm currently grappling with converting an image-heavy database from FM 11 to 12. I think I have a grip on the Container fields, but my case is made a little more complex, because my original Container images were inserted by means of copy-and-paste rather than the "Insert Picture" command. The result is that when I do the Conversion to the new Container Storage system, these pasted images get stored as (1) .jpg originals of the same small size as my original source images (small, about 15K) -- and (2) ._pct files, which are much larger (175K) and are the actual images used for display in the new FM12 Container field. All of these files are assigned generic, numbered names like Untitled_4.jpg or Untitled_4._pct . I've been experimenting, and basically what's going to work is moving these images out of the Storage Folder, deleting the reference in the new Container field, and then batch-importing the .jpg files using the "Import Folder" command and matching the Filenames to the database records. Onerous, but okay. The one thing I would like to be able to do, after the import, is to rename the stored images so that they are based on a unique Title Field -- like Colorado_4.jpg. I know I can't just re-name the images in the Storage Folder. . . . but I think there might be a way to rename the images either before I do the FM12 conversion -- or by importing them temporarily into a simple stored-in-the-File Container, and then dumping them over into the Remote Storage Container field. So, I'm having no luck finding a calculation function that "Gets" the name of an embedded image file -- or a script step of function that could rename it. Any help?
comment Posted April 21, 2012 Posted April 21, 2012 I'm having no luck finding a calculation function that "Gets" the name of an embedded image file If the image was pasted into the container field, then there is no image file and no name. You can (probably) export the field contents to a file, then reinsert the resulting image file back into the container. Note however, that the image format may vary according to the source from which it was copied (this is why you may see .jpg or .pct as the suggested file formats when exporting).
Wickerman Posted April 21, 2012 Author Posted April 21, 2012 Thanks Comment -- I think I understand this part and the export / re-import process. . . . what I'm getting art is simply the *file name* of the inserted image. When an image is properly inserted and then exported, it retains the name it had on the desktop before you put it into Filemaker, right? At least when i do an "Export Field Contents out of a container field, it lands on the desktop with the original name. So I'm wondering whether there is a means for me to *edit* that file name from within Filemaker, via a Calc or Script -- either in the 11 system, or in FM12 Managed Storage system? To Clarify once more -- I get it that when I pasted in the Images from the Mac clipboard, I *lost* the original filenames. But when I do the conversion, FM12 *does* create a generically named .jpg. I'm wondering if now there is a way to rename that .jpg from within FM (in either version).
Vaughan Posted April 23, 2012 Posted April 23, 2012 Export the image to the temp folder using a new name. Then import it back using the new name.
comment Posted April 23, 2012 Posted April 23, 2012 But when I do the conversion, FM12 *does* create a generically named .jpg. I'm wondering if now there is a way to rename that .jpg from within FM (in either version). It would be easy to do what Vaughan suggested - by scripting the export and using a script variable to name the exported image file. However, it would work only if you knew in advance what the file extension should be. Otherwise I would export the field contents using Filemaker's suggested name, rename the resulting image file using OS-level scripting or a plugin, and insert it back.
Recommended Posts
This topic is 4598 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