Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

does anybody know a free plug in that i can move , copy , delete and rename a file ?

thanks , :

mike

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.

  • Author

thanks bunch , Genx !!!

Mike

  • Author

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")

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

  • Author

Thanks , Genx ! i will try that.

mike

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))

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

got your plug-in, a little bit of documentation on that would be great!

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.

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!

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.

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

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!

Hmm I'll look at that tomorrow, shouldn't ever return blank. But glad to hear you got it working :

Hi Dempsey,

is it the way to do Your Plag In: MAC OS X compatible?

Regards

ino

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

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

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?...

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. :

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.