PreviousNext…

Show ’n’ tell XIV: attaching from the file system

It’s nowhere near Thursday.

That’s just how crazy I am.

I mentioned some code the other day. With this post it is now alive. A wee database that does two things, both of which are easily incorporated into whatever application you have in mind:

  1. Remove attachments from selected documents. This code is old-hat. We’re talking about some of my earliest Lotusscript ever. So go easy. Basically, for selected documents, any attachments are removed to a specified location (set in a nice custom dialog box). Job done. Useful for archiving ’n’ stuff ;-)
  2. The meat of the original request: parse all directories and sub-directories, starting from a specified location, attaching each file found to a separate Notes document

Now, this database does not entirely work on Mac clients. I know, I know. I am one of the biggest gobshites for shouting about Mac compatibility. But hey, gimme a break, I wanted to get the code out there fast, and I wrote this before I had a viable Mac / Notes installation to play with. All that said, I think I know how to make this work on a Mac so if there is any demand for adapting the code presented here to do just that, let me know—happy to oblige!

The relevant code is focussed in two agents, which call on basic script lbraries as required (including the optional OpenLog, of course). One of the agents uses a custom dialog box, as intimated earlier, so watch out for that when using the design. Any real issues, drop me a line, but the way the code hangs together should be pretty straightforward.

Download the database (78Kb).

Have fun. All feedback, as ever, appreciated (including any lucrative offers of work, natch ;-)).

P.S. the agent code is in “debug mode”; you might want to remove some of the verbose log statements in it. As for why I use OpenLog everywhere but in the Initialize event, I have no idea…!

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";