Manipulating Files & Folders without plugins

Errors, problems and troubles - Oh my! It seems as if more than half the coding done is for solving problems created by writing the code in the first place. Don't worry though, it happens to all of us. It's part of the coding process. You simply can't know all the variables.

You see, you're working in a known environment. The issues you fix are related to the problems which exist in your own computing environment. However, if you're putting something out there, you simply can't account for all possible issues. Not from the start.

Hopefully, at least on this issue, if you can learn from my lessons, I'll save you a ton of time. In my situation, with my Theme Studio product, it turns out that a good number of people using FileMaker do not use AutoUpdate, or at least have never had a reason to.

In FileMaker 9, FileMaker Inc. added a new shared extensions path for plugins. This shared extensions folder is where you can install a plugin and have it running for versions 9, 10 and 11. Here are the paths.

Windows XP:
C:\Documents and Settings\User Name\Local Settings\Application Data\FileMaker\Extensions

Windows Vista/7:
C:\Users\User Name\AppData\Local\FileMaker\Extensions

Mac OS X:
Macintosh HD/Users/User Name/Library/Application Support/FileMaker/Extensions

When trying to install a plugin, from a container, into this location, I was getting reports of errors and not being able to install the plugin. Silly OS messages would appear like "You don't have enough disk space.", etc.

There is where the topic of this video came in. Typically, I'm using a plugin to manipulate files and folders. I opt to use 360Work's ScriptMaster (of which there is a free version). The problem, however, if you haven't already figured it out, is that I can't us a plugin if it's not already installed yet. And I needed a folder in order to install the plugin - otherwise FileMaker was throwing an error.

So the question was, "How can I create a folder in order to install a plugin via AutoUpdate?"

The answer was to use the OS to create the folder. So here you have a video about using the OS in order to do all kinds of things. The example shown is that of working with folders, but it doesn't stop there.

If you understand the topic taught in this video then the limits to what you can do with FileMaker alone will expand SIGNIFICANTLY!

AttachmentSize
ManipulatingFilesFolders.zip244.19 KB

Comments

How can we watch on ipad

I'll be updating the web site in the early part of this coming year. Right now it's not in HTML5 format. Flash only unfortunately. :(

It's coming...

-- Matt Petrowsky - ISO FileMaker Magazine Editor

Does this folder creation functionality work on Mac only or Windows too?

Matt this truly is a fantastic piece of training work... Thank you
Spent a productive couple of hours adding to the VB to put the path created into a text file then read that back into FM, and then changed the last line of the Applescript to also return the path.... Means I can parse it
to then export a file. Am using this to do a setup file for a client which works out if Scriptmaster is installed, if it is then run autoupdate, if not create the folder export the plugin and then shut FM down...
Saved hours of boring work... thanks

I'm sure you figured this one out, but yes, this is a nice way to work with folders. If anyone takes a bit more time and learns about redirecting input and output from the command line then you can do a bunch of stuff with files too. ;)

Glad to know that my examples are helping people to get things done!

-- Matt Petrowsky - ISO FileMaker Magazine Editor

To minimize the CMD prompt and make it not so "Ugly" you can uncheck the "Bring target application to foreground". Give that a shot and lemme know what you think.

The cmd console will still show. While this is fine if FileMaker is maximized and in the foreground. You can still avoid it by going the VBScript route. You also get a lot more power with VBScript.

However, the CMD route is very fast for quick little things if you can afford to have the console window potentially show.

Thanks for the tip!

-- Matt Petrowsky - ISO FileMaker Magazine Editor

I am using this technique to export a Mac plugin. Because of the plugin format I must zip it to include in a container field. I get it exported to the shared auto update folder just find. Then I want to open the .zip file which will force an unzip. I am using the following but getting an error and no unzipping:

Perform AppleScript["do shell script \"open " & Substitute ( $$Path ; " " ; "\ " )]

Where $$Path is the path to the exported file.zip I have substituted any spaces in the path name ("Application Support" becomes "Application\ Support") with "\ ". I have also tried without the substitution...

Perform AppleScript["do shell script \"open " & $$Path]

Here is what $$Path Contains:
/Spanky/Users/douglasrawson/Library/Application Support/FileMaker/Extensions/POP3it_Pro_OSX.fmplugin.zip

Thanks - Doug Rawson

Dougie

Hello,

Great article.
About the missing Vbscript to verify if the creation of a folder on Windows was successful, through the Vbscript file.

Is it possible to obtain the Vbscript code that will generate the result of the cmd?

Beyond that, is it possible to pass the contents of a Filemaker variable with the full path of the folder to be created, into the Vbscript that will create the folder?

Thanks for any help