Basically, if I could see this, I'd (much) more likely be able to see where it was breaking. If it worked before, we should be able to tweak it to work again. If you could manage to upload a smallish file to a web site anywhere, and tell us here, then we could download it. Also, another question occurred just now; are you sure there are no external files needed, such as an external AppleScript applet, or a FileMaker plug-in? A missing required file would certainly not work.
I'm guessing that there is (considerable) AppleScript involved. It is true that there were some minor changes in FileMaker AppleScript behavior in FileMaker 7. I don't know of any since. There have certainly been some changes in FileMaker 10 vs. 7. But I suspect your problems are with the AppleScript that talks to iPhoto, or its interaction with FileMaker, or how the AppleScript was written, or iPhoto's AppleScript dictionary (not as likely). [Or some "not so good" FileMaker scripting; hard to tell.]
Then there were also changes in AppleScript, especially in OS 10.6+'s versions. For example, less sloppy rules for what Script Additions had access to, a security improvement, but could break earlier AppleScripts, depending on how they were written.
I've done very little with iPhoto's AppleScript. But I was able to put together a kind of "find" for "photos by date range". It returns simply a reference to that photo. But you can get and set various info, such as date (rw, "read/write"), image filename, image filepath, height, width (all r/o, "read only"), name (title of photo), latitude, longitude (both rw). It also has a "reverse geocode" command, which can return country, city, point of interest (?).
Currently the below AppleScript has the line returning the references to the photos found by date range commented out (not running). It has a later line running the same find, but returning the file paths of the images, in an AppleScript list (which would need coercing to paragraphs as text to use). But we'll see when we see your AppleScript(s).
AppleScript (best to paste into AppleScript Editor to read; looks mushed up here):
set d_1 to date "Sunday, June 19, 2005 12:00:00 AM"
-- entered manually as "6/19/2005 12:00:00 AM"
set d_2 to current date
tell application "iPhoto"
--date of photos -- just to see 'em, to copy one
--tell events album -- not sure what difference the 'tell' makes, as I only have 15 photos, and the default event; but likely could target specific named events
--set photos_by_dates to (every photo whose date is greater than or equal to d_1 and date is less than or equal to d_2)
-- length of photos_by_dates
-- get the file paths of the images, in Unix format; could be shown in FileMaker container fields (or repetitions of one, dynamically set, or via "find")
set paths_by_dates to (image path of every photo whose date is greater than or equal to d_1 and date is less than or equal to d_2)
-- AppleScript latest versions coerce any "date text" it can figure out into a full AppleScript text date for display. It will accept a FileMaker Timestamp fine.
Thanks for your prompt response. I will try your script suggestions. As I said, I've not done this before, but I am pretty technically savvy, so I can probably figure it out. I can share with you what I have been given by my friend. I am curious about what exactly the script instructions look at as far as the dates go. Is the script actually looking at thetime stamp on the photo? The script can 'burrow in' and see the date on the photo? Or is it looking at a title of the 'Event' which should contain the date?
# First fetch the date range from the current filemaker record
tell application "FileMaker Pro"tell current recordset startDate to cell "Date" set endDate to cell "Range"set startTime to cell "Start Time"set endTime to cell "End Time"set albumName to cell "Album" end tellend tell
# if there's no end date then use the start dateif endDate is "" then set endDate to startDate
set startDate to startDate & " " & startTime
if endTime is "" then set endTime to "23:59:59"
set endDate to endDate & " " & endTime
# filemakers dates come in as strings so we'll need to convert them
set startDate to date startDateset endDate to date endDate
tell application "iPhoto"
#If the album we need already exists then rename it first if exists album "Remote" then tell album "Remote" to set name to "Remote_old"end if # Now make a new albumnew album name "Remote"
#Put the photos into itif exists album albumName thenadd (every photo in album albumName whose date ≤ endDate and date ≥ startDate) to album "Remote"elseadd (every photo whose date ≤ endDate and date ≥ startDate) to album "Remote"
#Select it for displayselect album "Remote"
#Now remove the old gallery
if exists album "Remote_old" then remove album "Remote_old"end if
#Now purge starred itemsrepeat with kw in every keyword whose name contains "*" tell album "Remote" remove (every photo whose keywords contains kw) end tellend repeat
One last thing I should mention. The error messages I'm getting when I try to run the above script I posted.
After I click on an entry, I receive this message: Filemaker Pro got an error: object not found <ok>
Then the second window is: Unknown error: -1728 <ok>
First, my advice: Do not run scripts directly from FileMaker UNTIL you know it's working. FileMaker has no real AppleScript debugging tools. If you run AppleScripts first in AppleScript Editor, you can see WHERE the error occurs (it will be highlighted).
The "object not found" means exactly that. But what object? AppleScript Editor would show you. Basically AppleScript sees FileMaker from from the outside (more or less). FileMaker (later versions) itself cannot specify fields within scripts unless FileMaker knows what the table occurrence is. AppleScript has a default context of the current fields on the current layout. So, using the simple sytax you used, those fields have to be on the current layout, or you'll get that error. Or else the field's name is wrong.
I tested your script with a similar set up and AppleScript. It mostly worked. There was an error in the last section, "Now purge starred items." The "stars" are actually called the "rating" in iPhoto's AppleScript dictionary.* So if you really want to remove any photos which are starred:
remove (everyphotowhoseratingisgreater than 0)
* Every application which is AppleScriptable has an AppleScript Dictionary, which tells you what its objects and commands are. AppleScript Editor can display any of these in its "Library" window. There are several default apps already in there (incl. iPhoto). You can add any others (FileMaker's) with the "+" key. Choose the application file.
A couple of AppleScript Editor tips:
1. You can type just "app" and it will expand to "application"
2. You can just type "end" and it will expand to whatever kind of end you need (end tell, end if, end repeat, etc.); very useful in nested blocks.
I wanted you to know that I got the original script to work with help from you, and from my friend who gave me the script.
The problem seemed to be, that I needed to add another field to the database entitled "Album". That reflects a field referred to in the script.
My friend seemed to think that this was due to the newer version of Filemaker Pro, since he doesn't have this field visible in the database in browse mode.
Under the View menu, Go to Layout, and settings, there is a (is field the correct word?) that says Album. This was created to facilitate the
script running. (I'm sure you understand this. I can't explain it.) So I created another data field that is visible in the Browse mode, and defined it
as Album. Also, I have to view the database as All (Layout - Settings - All). Now everything runs.
Thanks again for your help.