Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6566 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

No, not a plugin (not a free one anyway), but you can use VBScript, or send event...

The following is an example of a vbscript that copies a file from a source path to a destination path:

Dim objFSO, objFileCopy

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFileCopy = objFSO.GetFile("C:MySourcePathFile.exe")

objFileCopy.Copy ("C:MyDestPathNewFile.exe")

To run it, just put it in a text field and export the field contents to a file specifying .vbs extension and choose the open after export command.

.. Or use Send Event -- I'm a bit rusty on my cmd scripting but this should move a file from point a to point b.

Move "C:MySourcePathFile.exe" "C:MyDestPathNewFile.exe"

Delete a file:

Del "C:MySourcePathFile.exe"

or

Erase "C:MySourcePathFile.exe"

Rename a File:

Ren "C:MySourcePathFile.exe" "NewFile.exe"

In FM you could format the above examples as follows in the send event calc:

"Move " & Quote("C:MySourcePathFile.exe") & " " & Quote("C:MyDestPathNewFile.exe")

If you really want real control and to be able to interact effectively with the OS, you might look at the GrokitTools vbscript plugin for FM -- It's cheap, but one of the best investments i've personally made.( www.grokittools.com )

OR... You could also just import into a container and then move that file wherever you want by exporting it to whatever location.

Posted

hi, genx ! i tried your visual basic code

in fm send event calc and it didn't work.

probably i did something wrong and can you clarify it for me.

i need to move and rename and delete image file.

can you give me exact formular to enter into send event calc field ? and do i need to install visual basic in my computer ?

as you know if i enter Ren "C:MySourcePathFile.exe" "NewFile.exe"

fm error pop up shows up and say :ren file can't be found" and so on.

so i make it < "ren"&"C:MySourcePathFile.exe"&" "&"NewFile.exe" and it didn't work neither.

thanks ,

mike

-------------------------------------------------

>> Delete a file:

Del "C:MySourcePathFile.exe"

or

Erase "C:MySourcePathFile.exe"

Rename a File:

Ren "C:MySourcePathFile.exe" "NewFile.exe"

In FM you could format the above examples as follows in the send event calc:

"Move " & Quote("C:MySourcePathFi le.exe") & " " & Quote("C:MyDestPathNewF ile.exe")

Posted (edited)

Okay firstly, Don't get the two confused... we have cmd line scripting and vbscripting -- the simple ones are cmd line.

Secondly, i forgot that you need to prefix cmd (to tell windows to use the command console to process your command) and /c to run the command and close the console or /k to run the command and show the console (useful for debugging. There are of course more options but i haven't used send event in a while so i forget them.

"cmd /c Move " & Quote("C:MySourcePathFi le.exe") & " " & Quote("C:MyDestPathNewF ile.exe")

Paste this into fm and just change source and dest path.

Let([

SourcePath = "C:MySourcePathFile.pdf" ;

Dest Path = "C:MyDestPath.pdf" ];

"cmd /c Move " & Quote(SourcePath) & " " & Quote(DestPath)")

Edited by Guest
Posted

Sorry, kill the last quote mark, it's just a stray

Let([

SourcePath = "C:MySourcePathFile.pdf" ;

Dest Path = "C:MyDestPath.pdf" ];

"cmd /c Move " & Quote(SourcePath) & " " & Quote(DestPath))

Posted

If you are still trying to find a solution to this, attached is a small Plugin I've been working on, which has some basic File, Folder and Zip functions.

If anyone finds it useful I may do some more work on it and add some more functions.

Dempsey

MooPlug.zip

Posted

Well I haven't got any documentation for it atm, the functions are pretty basic, FileMove accepts an sSource and sDest or something. Can't rememeber off top of my head and I'm on wrong computer atm.

Are there any paticular functions you want some help with? They all either return a path if you ziping etc or |Err_1 etc.

I'll try make a list of the errors somewhen.

Posted

Thanks for the reply... what I've been trying to use is the file exists function and i can't seem to get it to work:

I've tried:

Moo_FileExists( "C:test.pdf" )

Moo_FileExists( "C:/test.pdf" )

Moo_FileExists( "/C:/test.pdf" )

Moo_FileExists( "//C:/test.pdf" )

Moo_FileExists( "file:/C:/test.pdf" )

Moo_FileExists( "file://C:/test.pdf" )

Moo_FileExists( "filewin:/c:/test.pdf" )

so i guess the question is what's the file path and name supposed to look like?

10x!

Posted

Moo_FileExists( "C:test.pdf" )

should work, as I say, I don't have the code here, but I'll take a look 2moro and see what's going on, I've been working on the plugin quite a bit today, I may have broken some stuff while I was tidying up some code.

By the way, when you say you can't get it to work, does it return any value? I think that function just returns a text value of "True" or "False", as I couldn't figure out how to make it return an actual boolean value.

Posted (edited)

never mind... i think i got it...

"c:/test.pdf"

and i think it's case sensitive.

Great, thanks again!

Edit: it wasn't returning anything, but returns true or false now that i'm using "c:/test.pdf"

Edited by Guest
Posted

ok! finally:

if you have a script that assigns a variable the file exists command:

$test_var = Moo_FileExists( "c:/test.pdf" )

then i don't get anything in return neither true nor false. BUT if i do it like this:

$test_var = "my test: " & Moo_FileExists( "c:/test.pdf" )

then i get: my test: True in return (or false if the file doesn't exist).

Either way this will do it for me. Great stuff, you rule!

Posted

Its currently only for Windows, as that's all that was required at work, but I'll look into making an OS X version as well :

i'm thinking of adding some more functions to this plugin, as well as making it cross platform and then charging a nominal fee for it, just to say thanks, such as $40 or so a licence, i dunno. Can't remember pricing strucutr of Troi File Plugin, but it would deff be lower than that

Posted

Cool dude, do some more work on it. Basic functions that would be useful:

Delete Folder / File

Move Folder / File

Copy Folder / File

Rename Folder / File

FileExists

FileSize

Create Folder / File

Posted

maybe a getFileList(FolderName, separator) function?

You'd pass the folder name to the function and a separator like ; or , and you'd get back a string with all the files in that folder separated by... the separator. That would be TOTALLY COOL and i don't know if any of the current commercial plug-ins have that ... maybe it's not possible to do?...

Posted

Cool dude, do some more work on it. Basic functions that would be useful:

Delete Folder / File

Move Folder / File

Copy Folder / File

Rename Folder / File

FileExists

FileSize

Create Folder / File

Yea some of these already exist, but I'll add the rest :

maybe a getFileList(FolderName, separator) function?

Yea that sounds like quite a cool function, I'll work on that today. :

This topic is 6566 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.