Tag: plugins

FileMaker Custom Function for File Path to @Dropbox

FileMaker Pro

From the second version of my first database (back in 2002) I have used my FileMaker databases to control the creation of a structured folder system to enable the efficient and uniform storing of structured data for each of the businesses I have worked with.

Early on in my development of FileMaker systems I stumbled across the fantastic plugins offered by Troi Automatisering, in particular their File Plugin, now at version 5, which I will be creating this custom function to use.

This plugin enables me to create, with relative ease, a series of fields and scripts that allowed the automatic creation and opening of folders and files straight from the database. Relatively simple if you’re running FileMaker in a closed network, but it starts to get more complicated very quickly.

I’ve had the good fortune to design almost exclusively for Mac only networks (phew) although I have had to deal with mixed environments where my customers are still in transition from PCs to Macs so I’ve had to ensure that any system is compatible with both.

The Preparation

Determining the Windows System Version:

Since the route to the Documents folder hasn’t ever changed in Mac OS X I don’t need to worry about the version used, however, this is not the case in Windows where there is a different file path to the “My Documents” folder on Windows XP and the new versions Vista and Windows 7.

So I need to use the Get ( SystemVersion ) Function to determine whether or not the user is using Windows XP or a newer version. According to the FileMaker help the function returns the following information for Windows:

5.1 for Windows XP SP2

6.0 for Windows Vista

So I needed a test for which version of Windows is running. I did attempt to design my own custom function to determine this, but perhaps because I was unwell I wasted a good deal of time messing around with this before I came to my senses and looked at Matt’s github page.

His os.versionName custom function (which I’ve renamed as os.versions) is a quick and easy solution to this problem, which can go well beyond my needs, but will achieve what I want by returning the name of the Mac or Windows OS running on the users system.

It returns a simple easy to interpret name from the Get ( SystemVersion ) so the 5.1 response from the function is returned as “Windows XP” or 6.0 is returned as “Windows Vista”.

Dealing with Windows Folder Path Separators:

Windows file paths use the “\” separator. For some reason you can’t easily use these in FileMaker calculations (if someone knows why please let me know in the comments). So I’ve taken the easy step of creation of new global variable $$windowsnetworksymbol to contain the “\” separator.

n.b. To ensure this variable is set each time the FileMaker file is launched I’ve added it to a script called “Set Global Variables”, which I run as part of my start-up script.

Dealing with Mac Folder Path Separators

Mac file paths used by the plugin are formatted with the “:” separator. The only other thing you need to worry about is that a file path starts without any separator.

Get (DocumentsPath) Function

It is the product of this function that we have been working towards editing. The basic idea is to be able to call the Get ( DocumentsPath ) Function and then edit it’s product to point instead to the location of the Dropbox folder (assuming it is installed in the default location).

The Get ( DocumentsPath ) Function will return the following:

\C:\Documents and Settings\YourUserName\My Documents\ in Windows XP

\C:\Users\Your User Name\Documents\ in Vista or Windows 7

And we know from my earlier blog post: Default @Dropbox File Paths that the default file paths for Dropbox are:

\C:\Documents and Settings\YourUserName\My Documents\My Dropbox\ in Windows XP

\C:\Users\YourUserName\Documents\Dropbox\ in Vista or Windows 7

/Macintosh HD/Users/YourUserName/Dropbox/ in Mac OS X

So now we have all the building blocks in place it’s time to construct our custom function:

The path.dropbox Function

The function itself is relatively simple once we have done the above preparation. It has no parameters and is made up of a simple Case Statement which asks two questions:

1. Is the user running a version of Windows XP?

2. Is the user running either Windows Vista or Windows 7?

If both these questions are negative we will assume that the use is running Mac OS X.

Once we have determined which OS the user is using we will then grab the documents file path using the Get ( DocumentsPath ) Function and then reformat it to be compatible with the Troi File Plugin.

Formatting for Windows

We use the Replace Function to make this assessment:

Replace ( Get ( DocumentsPath ); 1; 3; “” )

This will replace the “\C:” part of the resulting Get ( DocumentsPath ) with simply “”.

We encase this Replace Function within a Substitute Function so that we can substitute the “/” separator for the “\” separator contained within our $$windowsnetworksymbol and get a properly formatted Windows file path for the Troi Plugin. So we get:

Substitute ((Replace (Get(DocumentsPath); 1; 3; “”)); [“/”; $$windowsnetworksymbol])

With both Windows File Paths to the Dropbox we then simply need to append the correct location which we can easily do by adding:

& “My Dropbox” & $$windowsnetworksymbol in Windows XP

& “Dropbox” & $$windowsnetworksymbol in Vista or Windows 7

Formatting for Mac

We again use Replace Function to remove the leading “/” and as before encase this within a Substitute Function so that we can substitute the “/” separator for the “:” separator. So we get:

Substitute ((Replace (Get(DocumentsPath); 1; 1; “”)); [“/”; “:”]; [“Documents:”; “”])

As you’ll notice we have also added to the Substitute Function a statement to replace the “Documents:”, which will strip back the Mac File Path to the User so we can then append:

& “Dropbox” & “:”

which will get us to the default location for the Dropbox on the Mac.

The Final Function:

Case (

os.version = “Windows XP 64-Bit” or “Windows XP”; Substitute ((Replace (Get(DocumentsPath); 1; 3; “”)); [“/”; $$windowsnetworksymbol]) & “My Dropbox” & $$windowsnetworksymbol;
os.version = “Windows 7” or “Windows Vista”; Substitute ((Replace (Get(DocumentsPath); 1; 3; “”)); [“/”; $$windowsnetworksymbol]) & “Dropbox” & $$windowsnetworksymbol;
Substitute ((Replace (Get(DocumentsPath); 1; 1; “”)); [“/”; “:”]; [“Documents:”; “”]) & “Dropbox” & “:”

)

Please note that I have not yet had the opportunity to test this on a Windows system, but I’ve followed paths that worked in the past. As soon as I have had the opportunity to test it I will post any corrections here.

Filed under: FilemakerTagged with: , , , , , , , , , , , ,

Backing up WordPress

Wordpress Logo

Update: This post is no longer accurate, I now recommend UpdraftPlus Backup.

As a recent convert to WordPress (within the last 12 months) it has been one of the last areas I have considered putting backups in place. In the decade I have been working with websites (I currently manage two dozen or so) I have never had a web hosting company lose a website. Consequentially backups of our various websites have invariably been kept to note changes we have made to them, rather than to give us a backup of the site should the web host fail in their obligations.

As a relatively new user to WordPress I have watched it move from version 2.7 to 2.9 (with plenty of .1 upgrades in-between) in little less than 12 months. Each time a new version has been released WordPress has discretely pressed me to update it and obligingly I have complied, each time holding my breath for a good few seconds, until that welcome success message is returned and I am sure that my databases are intact (the real risk of corruption).

So in line with my New Year’s resolution to make sure that everything is backed-up and in recognition that most of the html content of my sites (excluding WordPress) is now additionally supported by  git, which acts as an effective backup process in my opinion. I thought it was about time I found a suitable, easy solution for backing-up WordPress and that solution came via a new beta program called WordPress Backup.

Though the site is little more than a year old (it celebrates it’s first year anniversary of its beta on 14th January) it offers an easy, automatic method to backup your site via the installation of a plugin in WordPress, which is complimented by a free account (so long as it’s for personal use or you just need to backup one site) with WordPress Backup. Overall the setup process takes less than ten minutes (instructions here) and after that automatic backups are made every two days to its servers, from which you can download a backup if your site corrupts.

Thanks to the development team at WordPress Backup I and the 2571 other users it caters to are able to easily and seamlessly ensure that we have a modicum of protection when upgrading between different versions of WordPress (and any unforeseen horrors that may happen) and work, such as this, is finally protected. Phew.

Filed under: wordpressTagged with: , ,

ClicktoFlash

We all love browser plugins, it’s one of the reasons that Firefox is so darn popular. But if you prefer the cleaner interface of Safari 4 (as I do) you needn’t miss out from some of these essential improvements to your browsing experience, the most important of which (in MHO) is Click to Flash, your own flash blocker.

Click to Flash is the wunderbar creation of Jonathan ‘Wolf’ Rentzsch of Chicago it’s basic job is to prevent flash from loading until you want it to. Replacing flash files with this nifty clean-looking replacement image:

Click to Flash Replacement Image
Click to Flash Replacement Image

Which you just click when you want to view the flash file in question. So no more annoying ads, preloading videos, Flash basically, which as I am sure you all appreciate is now a bigger preverbal pain in the butt since it was relegated to a sandboxed status is Snow Tabby.

So download, install and get back to browsing the internet quickly and efficiently, only seeing flash where you want to. Importantly it’s designed to allow sIFR images to load automatically, replace youtube videos with their H.264 equivalent played in quicktime where possible and allows whitelisting of sites where you always want flash to load.

I’m really enjoying this plugin, I hope you will too.

Filed under: GeneralTagged with: , , ,

Quicklook Magic

Looking through a large set of files has become increasingly easy since Apple released Leopard, and although this feature does not get a great deal of promotional praise from the Apple community it is in my opinion one of the unsung heroes features of the OS.

With the update to Snow Leopard you can now use quicklook just about everywhere, from the finder and spotlight as you might expect, but also from places as diverse as your printer list (to check which document might be causing your printer to play-up or move a file up the queue) to your open dialog box (say to check you are attaching the right file to an email. And I am sure many more places I’m yet to discover.

Apple has enabled Quicklook to work with essential files such as word documents, excel spreadsheets and of course pdfs, as well as just about any image you’d ever be likely to encounter in a normal business environment. It is however possible to extend the usefulness of this system by installing plugins to enable you to look at many other types of files that Apple has not added native support for.

Quicklook plugins are indicated by the file ending: .qlgenerator. To install them you copy them to your /Library/QuickLook/ or ~/Library/QuickLook/ folder.

Install your Quicklook Plugins here
Install your Quicklook Plugins here

The folder should already exist, but if it doesn’t feel free to create it. Out of preference I normally install these files into my root library rather than the user library as they are then available to any user of the computer. I have encountered no additional increase in load on the system of running these plugins.

Once installed you have to run the following command in terminal if you want them to be loaded straight away without needing to logout. This is as easy as cutting and pasting this command into the terminal app (hiding away in utilities):

qlmanage -r

which forces the OS to look in these folders and thereby load the new plugins you have added.

I also take a very broad sweep when installing this type of plugin as it is not possible to encounter every file type that a business or yourself will encounter and I have therefore installed pretty much every plugin that I have been able to lay my hands on, occasionally checking back at great sites like www.quicklookplugins.com or www.qlplugins.com when I need to find another plugin.

I currently have installed on my system the following plugins:

Adium Chat Log

– yes easy peaking in my favourite IM’s chat logs

Photoshop Brush Viewer

– does what it says on the tin, kindly developed by Laura Dickey.

Source Code Highlight

– view source code files with syntax highlighting courtesy of Samuel Toulouse.

EPS Files

– look at EPS files courtesy of Eternal Storm Software it’s donationware so if you use it lots donate!

Folder Contents

– if you still us 10.5, seems to have stopped working in 10.6, :-(

GIS Data

– view vector data and raster grids, helpful to those in the property development game courtesy of Bernhard Jenny.

Text and Picture Clippings

– have a look at annoying clippings files!

Adobe Illustrator

– this one is a bit more complicated but it is definitely worth the effort for detailed instructions see: here. Thanks Hrmpf!

Web Page Archives from IE

– helpful for legacy files and archives that your client might have and not realise that they later need.

CHM Archives

– again that legacy file support that can be so useful at times, thanks go to Qian Qian.

Applescript Viewer

– take a peek at any applescripts you might have, thanks go to Kainjow.

Suspicious Package

– for the cautious amongst you who want to checkout what that installer package contains, thanks to Mothers Ruin Software.

Textmate

– essential for all you textmate fans, thanks go to Ciarán Walsh.

Zips etc.

– Look inside those zip files without having to unzip them.

And that’s the end of my list, but I’d love to hear any recommendations anyone might have. Many thanks to all the cool developers who have spent time creating these incredibly useful plugins.

Filed under: GeneralTagged with: , , , , ,