How do I save a found set in a script?

Support, Questions and Suggestions for the FM7 Version of CC Calendar.
Posts: 22
Joined: Tue Aug 23, 2005 3:40 pm
PostPosted: Tue Aug 30, 2005 5:54 am
Hi,

I want to export an ics file for each of my resources separately, then have the Event Plugin automate this for me.

How do I script the Find settings?

I want to copy and edit "Export Appointment Found Set as iCal" to have the search paramaters in it.

For Example - Find all ResourceA for all time, or between two dates, or after a certain date.
Posts: 19
Joined: Thu Jul 07, 2005 3:24 pm
PostPosted: Thu Sep 01, 2005 1:34 pm
Heya -

What we did was run an loop script that looks like this: (not FM code)

go to layout with resources
go to first record
loop
go to related records in appointments (in new window, name it TEMP or something)
enter find mode, specify criteria to your date range, then constrain found set
run export script if found count > 0
close window "TEMP"
go to next record in resources
end loop

This will basically loop through all the resources and export all the related appointments for those resources. We then run an AppleScript that renames the exported file, but I suspect that with FM8 there's a better way to name the file. I just haven't played enough with it.

Hope that helps!
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Sep 12, 2005 3:33 am
TheCharlie wrote:We then run an AppleScript that renames the exported file, but I suspect that with FM8 there's a better way to name the file. I just haven't played enough with it.


Here is what we do in FM8. In the Export Found Set as iCal script, we inserted a Set Variable step right before the loop:

Set Variable
Name: $FilePath
Value: "file:" & Get ( DesktopPath ) & Substitute ( LeftValues ( AppointmentsDaily::ApptType ; 1 ) ; "¶" ; "" ) & ".ics"

Note that this names the file with the type of the first appointment in the found set: very useful if you're exporting each appointment type as its own found set. When these different files are then brought into iCal, each gets their own color (in PHPiCalendar they are each their own "calendar").

Then, in the Export Record step, you just use the variable name $FilePath as the export path.
John Sindelar
SeedCode

Return to CC Calendar (FM7/8)

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: