Archive for June, 2007

The FileMaker Magic Eight Ball

Tuesday, June 19th, 2007

Input: Will I get that promotion I’ve been waiting for?
Answer: Signs point to yes

This is a not-so-elegant take on the classic Eight Ball. Enter any question at all and get a random answer, just like the actual Eight Ball novelty ofyesteryear. Enjoy

Case(

0 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96

)

318 Kerio Migration Article

Saturday, June 16th, 2007

Article about 318 on Apple.com, focusing on a project we did integrating Kerio to replace Microsoft Exchange, giving our client the ability to centralize all of their server assets into an Open Directory environment while still using MAPI to provide groupware components to their user base, have handheld devices that sync with their Calendar/Mail/Contacts and of course, use the standard Exchange features of mail, etc. Good stuff:

http://consultants.apple.com/at_a_glance/318inc/

Converting a Kerio Mail Server Calendar to a Standard .ics File

Thursday, June 14th, 2007

While you can view a Kerio MailServer calendar in iCal by subscribing to the Kerio Mailserver URL, sometimes it may be necessary to get ahold of an actual .ICS calendar file for the account you are working with. Kerio MailServer itself does not store .ICS files, but rather generates them on the fly. This poses a problem if you need access to a real file type.

To get an .ICS file for a Kerio MailServer account, perform the following shell script.

sudo curl http://yourdomain.com/ical -u username:password > /Users/username/Documents/CalendarName.ics
chmod 777 /Users/username/Documents/CalendarName.ics

This example script would grab the datastream from Kerio and store it in your local documents folder. If you need the data to be constantly up-to-date, setup a crontab with an appropriate interval to update your data.

Migrating Entourage

Tuesday, June 12th, 2007

For years, we’ve had issues with the fact that there is no good built-in auto-archive feature for Entourage. This has led to many an Exchange environment getting out of control with a lot of Mac clients. To get around this issue, check out Entourage Email Archive X 3.4.0. It’s a utility for archiving emails and/or attachments for Entourage in Mac OS X. EEAX 3.x works on OS X 10.4.x (Tiger) with Microsoft Entourage 2004. You can Download latest EEAX 3.4.0 from:

http://www.versiontracker.com/dyn/moreinfo/macosx/14011

If you need an evaluation copy drop an email to: info@softhing.com.

NAV: Counting Open Windows In FileMaker

Tuesday, June 12th, 2007

This function will give you an active count of how many windows you have open to better maximize your window control.

function name: f_openSystemWindows

copy and paste code below:

Let( [

nextFile = GetValue( fileNames; 1 );
fileCount = ValueCount( fileNames )
];

ValueCount( WindowNames( nextFile ) ) +
If( fileCount > 1;
f_OpenSystemWindows( RightValues( fileNames; fileCount – 1 ) );
//else
0 )

)

NAV: Capturing and Restoring Active Layout Tabs in FileMaker

Sunday, June 10th, 2007

Ever navigate away from a layout via a script and when you return, you’re on the layout’s default tab instead of the tab you were working under? Ever feel cold, desolate and alone?

The combination of the custom function and scripts below will allow you to script return navigation without abandonment of tabs. (3 tab levels deep)

function name: f_ActiveTabs

copy and past code below:

Let( [ objectNames = LayoutObjectNames ( Get( FileName) ; Get( LayoutName) );
currObj = GetValue ( objectNames ; objectNum )] ;

If( objectNum <= ValueCount( objectNames);

If( GetLayoutObjectAttribute ( currObj; "isFrontTabPanel") and
Let( parentObj = GetLayoutObjectAttribute ( currObj; "enclosingObject");
IsEmpty( parentObj ) or GetLayoutObjectAttribute ( parentObj; "isFrontTabPanel")) ;
currObj & ¶
) &
f_ActiveTabs( objectNum + 1)

)

)

Scripts:
GrabTabs = Set Variable [$$frontTabs; Value:f_ActiveTabs (1)]
Restore Tabs = Set Variable [$count; Value:1]
Loop
Go to Object [Object Name: GetValue ( $$frontTabs; $count )]
Set Variable [$count; Value:$count + 1]
Exit Loop If [$count > ValueCount( $$frontTabs )]
End Loop

Converting Kerio Mail Server Contact Objects to vCards from Command Line/Scripts

Friday, June 8th, 2007

Kerio MailServer stores all contact items as individual *.eml files. Sometimes you may which to save these items as vCards for use in Address Book or another contact management application.

In order to grab all contacts from a particular user’s Kerio MailServer store and export them to another folder as vCards, you can use the following shell script.

# 1. Define the user’s contacts directory in the Kerio MailServer store.
# yourdomain.com is the email domain.
# username is the Kerio Mailserver account.
KERIO_CONTACTS=’/usr/local/kerio/mailserver/store/mail/yourdomain.com/username/Contacts/#msgs’
#
# 2. Define user account who will own the exported files
# For example: use www if exported to a website or your shortname if using on your local machine.
OWNER=”www”
#
#3. Define Directory to store the exported files
# For Example: Your local documents folder
VCARDS=”/Users/Username/Documents/”
#
# 4. Grab .eml objects and convert
#
# First make a temporary directory
mkdir -p “$VCARDS/temp”
#
# Copy eml objects to temporary directory
cd “$KERIO_CONTACTS”
cp *.eml “$VCARDS/temp”
#
# Loop over contacts and convert
cd “$VCARDS/temp”
for vcard in *.eml
do
sed -e ‘s/.$// ; 1,/^$/ d’ <$vcard | iconv -f UTF8 -t MACROMAN > “$VCARDS/${vcard/%eml/vcf}”
done;
#
#Change permissions and remove temp directory
rm -rf “$VCARDS/temp”
chown -R $OWNER “$VCARDS”

Building Recursive Functions in FileMaker

Friday, June 1st, 2007

This is an example of a recursive function:

Name of Function (name whatever gives a clear indication of what the function does – in this instnance I’ll use a generic name)

f_Recursion

Parameter: n

Code:

If ( n > 1 ;
f_Recursion( n-1 ) & ¶ ; “”

)
&
GetNthRecord ( tableName::feildName ; n )

This will return a list of every value for the related set of records in that field. Note that recursion has about a 25,000 record limit.

Using Output from Recursive Functions in FileMaker

Friday, June 1st, 2007

One of the ways to use a recursive function is to build a list and then test to see if a specific value exists in that list. To determine if a value exists in the list, the following method is usefull:

1. Build a calculation field that builds a list with the custom recursive function.

2. Build a calculation field or know the field that contains the value you need to test for.

3. Build a custom function as follows:

Name: f_valueInList

Parameters: checkList, checkValue

Code:

not IsEmpty( checkList ) and Position ( ¶ & checkList & ¶ ; ¶ & checkValue & ¶; 1 ; 1 ) > 0

4. Build a field that uses the custom function you just created. For the paramters of the custom function, use the calc field that you created in step 1 above for the “chekList” parameter and the calc field that you created in step 2 above for the “checkValue” paramter.

You can now determine whether a dynamically occurring value or static value exists in a dynamically changing group of records.