Vbscript and FileMaker Pro 6 Windows XP

  • Follow


I'm looking to create a Vbscript that checks to see whether FileMaker Pro
6.0v4 on Windows XP has any open files. If it doesn't I'd like it to create
a .zip file from a folder containing some FM Pro databases.

Has anybody created something like this before or can point me in the right
direction?

Many thanks,
Andrew

0
Reply Peter 11/8/2003 4:15:24 AM

"Peter Pan" <splash@NOSPAMPLEASEmac.com> wrote in message
news:BBD2B90B.1AF36%splash@NOSPAMPLEASEmac.com...
> I'm looking to create a Vbscript that checks to see whether FileMaker Pro
> 6.0v4 on Windows XP has any open files. If it doesn't I'd like it to
create
> a .zip file from a folder containing some FM Pro databases.
>
> Has anybody created something like this before or can point me in the
right
> direction?
>
> Many thanks,
> Andrew
>

Hello Andrew,

To check if FMP is open, you would think of using the GetObject() function
and see whether it point to an object or not (in the latter case it contains
a null value). But checking this on my computer (WinXP Professional), the
GetObject() and CreateObject() are basically doing the same job regarding to
FileMaker. So i tested this:

Dim app
Dim i
Set app = GetObject("","FMPRO.Application")
i=app.Documents.Count        'Now i contains the number of files open
app.Quit
Set App=nothing

and it worked!

Regarding the creation of zip files, you need to specifiy more: how would
you think you 'd do it?



hope this helps,



Jeroen



0
Reply Jeroen 11/8/2003 1:09:16 PM


If your goal is to perform a backup of the FMP files in a .zip format,
no need of VBscripts. There is a small but excellent software,
unexpensive, called Backup 2001, available on the web. Other advantage
: it is able to backup open FMP files... I tested it and it works.

HTH.

Peter Pan <splash@NOSPAMPLEASEmac.com> wrote in message news:<BBD2B90B.1AF36%splash@NOSPAMPLEASEmac.com>...
> I'm looking to create a Vbscript that checks to see whether FileMaker Pro
> 6.0v4 on Windows XP has any open files. If it doesn't I'd like it to create
> a .zip file from a folder containing some FM Pro databases.
> 
> Has anybody created something like this before or can point me in the right
> direction?
> 
> Many thanks,
> Andrew
0
Reply christian 11/8/2003 4:36:36 PM

It is extremely dangerous to backup OPEN FileMaker files.  When FMP starts
up, it check the status of a certain flag... if that flag is off, the
application starts up with the normal procedure, which includes turning the
flag on.  When FileMaker shuts down properly, it turns the flag off.  If the
flag is ON when FileMaker first starts up again, then FileMaker performs a
consistency check which can at time cause more harm than good.


0
Reply Mariano 11/9/2003 10:30:32 PM

"Jeroen Aarts" <jeraarts@NSantwerpen.be> wrote in message
news:3faceafd$0$3996$ba620e4c@reader0.news.skynet.be...
>
> "Peter Pan" <splash@NOSPAMPLEASEmac.com> wrote in message
> news:BBD2B90B.1AF36%splash@NOSPAMPLEASEmac.com...
> > I'm looking to create a Vbscript that checks to see whether FileMaker
Pro
> > 6.0v4 on Windows XP has any open files. If it doesn't I'd like it to
> create
> > a .zip file from a folder containing some FM Pro databases.
> >
> > Has anybody created something like this before or can point me in the
> right
> > direction?
> >
> > Many thanks,
> > Andrew
> >
>
> Hello Andrew,
>
> To check if FMP is open, you would think of using the GetObject() function
> and see whether it point to an object or not (in the latter case it
contains
> a null value). But checking this on my computer (WinXP Professional), the
> GetObject() and CreateObject() are basically doing the same job regarding
to
> FileMaker. So i tested this:
>
> Dim app
> Dim i
> Set app = GetObject("","FMPRO.Application")
> i=app.Documents.Count        'Now i contains the number of files open
> app.Quit
> Set App=nothing
>
> and it worked!
>
> Regarding the creation of zip files, you need to specifiy more: how would
> you think you 'd do it?
>
>
>
> hope this helps,
>
Hi Jeroen,

Thanks for your reply, I don't know much if anything about vbscript so will
have to do some testing. What I would like to do is have a
script/routine/command whatever that first checks that there are no open
FileMaker Pro v6 files (and close any if they are open) then backup a
specified folder into a .zip archive, which I can then move to another
computer for tape backup as well.

Kind regards,
Andrew


0
Reply Andrew 12/8/2003 3:51:09 AM

Hi Andrew,

I missed the beginning of this thread, but I will take your last reply for
the original question. If you mean that you want to poll for open files from
within Filemaker (as opposed to from the OS, which would  involve some sort
of non-FMP scripting, VBS being the most likely candidate on Windows), then
you can use DatabaseNames() to get a list of open files. But it sounds more
like you simply want to close all open files, which probably means you can
just exit the app. So, you could open a file whose on open script step is
Exit Application.

But now you've got no backup to .zip. For that, I'd suggest the Archive
Toolbox plugin from Sitecraft:

http://www.sitecraft.com/at_detail.lasso

...which can do just about anything you want with compression.

The two functions (checking for open and archiving) might be tough to run
from one file on open, as the Exit call will obviously trump any calls to
the plugin. You could compare a list of the files you don't want open to a
list returned from DatabaseNames(), and, if there are no hits, branch off
logically and call the plugin; otherwise, throw up a message, Exit, and
start again. But, of course, that 'start again' would need to be executed
manually.

But if you can manage the VBS, you are likely to gain greater control there.

-- 
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance


"Andrew" <splash@NOSPAM.mac.com> wrote in message
news:NySAb.43930$aT.21856@news-server.bigpond.net.au...
>
> "Jeroen Aarts" <jeraarts@NSantwerpen.be> wrote in message
> news:3faceafd$0$3996$ba620e4c@reader0.news.skynet.be...
> >
> > "Peter Pan" <splash@NOSPAMPLEASEmac.com> wrote in message
> > news:BBD2B90B.1AF36%splash@NOSPAMPLEASEmac.com...
> > > I'm looking to create a Vbscript that checks to see whether FileMaker
> Pro
> > > 6.0v4 on Windows XP has any open files. If it doesn't I'd like it to
> > create
> > > a .zip file from a folder containing some FM Pro databases.
> > >
> > > Has anybody created something like this before or can point me in the
> > right
> > > direction?
> > >
> > > Many thanks,
> > > Andrew
> > >
> >
> > Hello Andrew,
> >
> > To check if FMP is open, you would think of using the GetObject()
function
> > and see whether it point to an object or not (in the latter case it
> contains
> > a null value). But checking this on my computer (WinXP Professional),
the
> > GetObject() and CreateObject() are basically doing the same job
regarding
> to
> > FileMaker. So i tested this:
> >
> > Dim app
> > Dim i
> > Set app = GetObject("","FMPRO.Application")
> > i=app.Documents.Count        'Now i contains the number of files open
> > app.Quit
> > Set App=nothing
> >
> > and it worked!
> >
> > Regarding the creation of zip files, you need to specifiy more: how
would
> > you think you 'd do it?
> >
> >
> >
> > hope this helps,
> >
> Hi Jeroen,
>
> Thanks for your reply, I don't know much if anything about vbscript so
will
> have to do some testing. What I would like to do is have a
> script/routine/command whatever that first checks that there are no open
> FileMaker Pro v6 files (and close any if they are open) then backup a
> specified folder into a .zip archive, which I can then move to another
> computer for tape backup as well.
>
> Kind regards,
> Andrew
>
>


0
Reply John 12/8/2003 4:42:42 AM

Hi,

John's tip is probably the best and easiest way to do it. If you'd prefer to
do it from outside FM, use this VBScript to check for open files:

    Dim app
    Dim i

    Set app = CreateObject("FMPRO.Application")
    i=app.Documents.Count
    If(i > 0) Then
         app.Documents.Close()    'If you want to check for specific files,
use app.Documents("<filename>")
    End If
    app.Quit       'Only if you want to quit FileMaker
    Set app = nothing

Then add the execution of this script as a scheduled task under Windows. I
do not know a compression apps that supports activeX automation, so i would
not know a way to automate backup archiving using VBScript. You can combine
though the VBScript that checks for open files with an automated backup
routine. Try for example this link:

http://www.softcities.com/Active-Backup-Expert-Pro/download/3519.htm

Regards,



Jeroen

"John Weinshel" <john@datagrace.biz> wrote in message
news:vt808uba579sb0@news.supernews.com...
> Hi Andrew,
>
> I missed the beginning of this thread, but I will take your last reply for
> the original question. If you mean that you want to poll for open files
from
> within Filemaker (as opposed to from the OS, which would  involve some
sort
> of non-FMP scripting, VBS being the most likely candidate on Windows),
then
> you can use DatabaseNames() to get a list of open files. But it sounds
more
> like you simply want to close all open files, which probably means you can
> just exit the app. So, you could open a file whose on open script step is
> Exit Application.
>
> But now you've got no backup to .zip. For that, I'd suggest the Archive
> Toolbox plugin from Sitecraft:
>
> http://www.sitecraft.com/at_detail.lasso
>
> ..which can do just about anything you want with compression.
>
> The two functions (checking for open and archiving) might be tough to run
> from one file on open, as the Exit call will obviously trump any calls to
> the plugin. You could compare a list of the files you don't want open to a
> list returned from DatabaseNames(), and, if there are no hits, branch off
> logically and call the plugin; otherwise, throw up a message, Exit, and
> start again. But, of course, that 'start again' would need to be executed
> manually.
>
> But if you can manage the VBS, you are likely to gain greater control
there.
>
> -- 
> John Weinshel
> Datagrace
> Vashon Island, WA
> (206) 463-1634
> Associate Member, Filemaker Solutions Alliance
>
>
> "Andrew" <splash@NOSPAM.mac.com> wrote in message
> news:NySAb.43930$aT.21856@news-server.bigpond.net.au...
> >
> > "Jeroen Aarts" <jeraarts@NSantwerpen.be> wrote in message
> > news:3faceafd$0$3996$ba620e4c@reader0.news.skynet.be...
> > >
> > > "Peter Pan" <splash@NOSPAMPLEASEmac.com> wrote in message
> > > news:BBD2B90B.1AF36%splash@NOSPAMPLEASEmac.com...
> > > > I'm looking to create a Vbscript that checks to see whether
FileMaker
> > Pro
> > > > 6.0v4 on Windows XP has any open files. If it doesn't I'd like it to
> > > create
> > > > a .zip file from a folder containing some FM Pro databases.
> > > >
> > > > Has anybody created something like this before or can point me in
the
> > > right
> > > > direction?
> > > >
> > > > Many thanks,
> > > > Andrew
> > > >
> > >
> > > Hello Andrew,
> > >
> > > To check if FMP is open, you would think of using the GetObject()
> function
> > > and see whether it point to an object or not (in the latter case it
> > contains
> > > a null value). But checking this on my computer (WinXP Professional),
> the
> > > GetObject() and CreateObject() are basically doing the same job
> regarding
> > to
> > > FileMaker. So i tested this:
> > >
> > > Dim app
> > > Dim i
> > > Set app = GetObject("","FMPRO.Application")
> > > i=app.Documents.Count        'Now i contains the number of files open
> > > app.Quit
> > > Set App=nothing
> > >
> > > and it worked!
> > >
> > > Regarding the creation of zip files, you need to specifiy more: how
> would
> > > you think you 'd do it?
> > >
> > >
> > >
> > > hope this helps,
> > >
> > Hi Jeroen,
> >
> > Thanks for your reply, I don't know much if anything about vbscript so
> will
> > have to do some testing. What I would like to do is have a
> > script/routine/command whatever that first checks that there are no open
> > FileMaker Pro v6 files (and close any if they are open) then backup a
> > specified folder into a .zip archive, which I can then move to another
> > computer for tape backup as well.
> >
> > Kind regards,
> > Andrew
> >
> >
>
>


0
Reply Jeroen 12/8/2003 7:29:14 PM

6 Replies
2283 Views

(page loaded in 0.105 seconds)

Similiar Articles:













7/26/2012 3:38:55 PM


Reply: