April 9, 200421 yr Newbies I am building a soultion which tracks individual images inside of a larger job. Right now, I enter the image thumbnail into the portal which creates a new record in the "Images" file. This is helpfull to me because all of the overall job info is automatically built into the image record in the "Images" file. I was hoping to use import to bring in an entire folder of images into the portal so that I don't have to insert them one at a time. I would like to use a script to import a folder full of images, and I would like to specify which folder to use each time I run the script. When I use "Import Records" in a script though, I am not allowed to specify a folder - instead it seems to only look for a file. Any ideas? FileMaker Version: 6 Platform: Mac OS 9
April 9, 200421 yr Author Newbies I'm not sure what you mean. How do I drop down options for Import in a script? - and make the importing path variable for each use?
April 9, 200421 yr I see what you mean. I have only used Import Folder on a fixed folder. Before v.6 I used AppleScript to get images. Basically you can't do what you want exactly in v.6, because, in a script, unless you specify a fixed folder, the Import reverts to its default settings of "Import File," which is the same as the menu command, i.e., starting from scratch. I just tried it in v.7 and it does not revert. You can uncheck Specify and it remembers that you wanted to import a folder. If you are really serious about automating this is 6 the only solution (I can see) is to set up the import for a fixed folder, then use AppleScript to choose a folder, move and rename it to your "fixed folder," then move it back to where it was. It's a little complex with the name changes, etc., but it's not really that difficult for the computer, because it's not "copying" the files, it's just changing the location of a folder, then changing it back. Of course, you could do the same manually. But I guess you've thought of that :-| All and all, I would consider upgrading to 7 for this; it seems to have much better image file handling abilities. But I also see OS 9, so you'd have to go to X. Here is an AppleScript that would do it. But you'd have to modify it somewhat to put directly into FileMaker. I only ran it in Script Editor to watch it move the folder there and back. It would actually be 3 FileMaker scripts, the first and last being Perform AppleScripts: 1. Choose, move and rename image folder, 2. Import images, 3. Move folder back. -- 1. tell application "Finder" set theFolder to choose folder with prompt "Pick folder to move" set origFolder to container of theFolder -- get the enclosing folder, so you can move it back later -- you would have to set this and the name below into FileMaker global fields set origName to name of theFolder set FM_folder to choose folder with prompt "Pick folder to move to" -- You would set this fixed location from a FileMaker field, a full folder path -- I'm just picking it here so I can try it set endFolder to move theFolder to FM_folder -- Move folder to the fixed location set name of endFolder to "PhotoImport" -- set the name to the fixed name. You could set from a FileMaker field instead.. (* turned off so I can run script in Script Editor tell application "FileMaker Pro" -- above not needed in FileMaker, nor end tell tell document 1 set cell "origName" to origName set cell "origFolder" to origFolder end tell end tell *) delay 5 -- This is where the 1st script stops. I delay only so I can see the folder before I move it back. -- 2. IMPORT THE FIXED FOLDER WITH IMAGES, a FileMaker script -- 3. Run below as a separate FileMaker Perform AppleScript step. (* tell application "FileMaker Pro" -- above not needed in FileMaker, nor end tell tell document 1 set origName to cell "origName" set origFolder to cell "origFolder" set fixedFolder to cell "fixedFolder" end tell end tell *) -- You would NOT use step below in the FileMaker script. But this is what the folder is now set fixedFolder to (FM_folder as string) & "PhotoImport" set backFolder to move folder fixedFolder to origFolder -- Move folder back to where it was with original name set name of backFolder to origName end tell
April 10, 200421 yr Author Newbies Thanks so much - your advice is hugely helpful. I'll upgrade to 7 ASAP.
April 11, 200421 yr I thought you might :-) I did have fun moving a folder then moving it back. Real exciting.
Create an account or sign in to comment