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.

Using Command Line Events

Featured Replies

I have been having a little difficulty with a scipt to export data out as a merge file, rename the file, and move it to a mapped network drive.

I am running a script to loop and export multiple exports with a three second pause to rename and move the file from the curent folder. The exported file is placed in the current folder as “Cutlist.csv.” Using the Send Mesage script step the file is renamed and moved with a Send Mesasge script step.

Rename:

"CMD /C " &

"RENAME " & """" & Substitute( Substitute( Substitute( Status( CurrentFilePath) , "file://" , "" ) , "/" , "" ) , Status( CurrentFileName) , "" ) & _Optimizer_FileName & """" & " " &

Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute(

Trim( Substitute( Substitute( Job # , "." , "" ) , "¶" , "" ) ) & "_WO" &

Trim( Substitute( Substitute( WO # , "." , "" ) , "¶" , "" ) ) & "_" &

Trim( Substitute( Substitute( LeftWords( Mat Description , 5 ) , " " , "" ) , "¶" , "" ) ) ,

"," , "" ) , "+" , "" ) , "*" , "" ) , "/" , "-" ) , "^" , "" ) , "&" , "" ) , "=" , "" ) , ">" , "" ) , "<" , "" ) , "(" , "" ) , ")" , "" ) , ";" , "" ) , ":" , "" ) , """" , "" ) , "." , "" ) & ".csv"

Sample output = CMD /C RENAME "C:PRODINFOCutlist.csv" 2499_WO2516_13mmBirchPly.csv

Move:

"CMD /C " &

"MOVE " & """" &

Substitute( Substitute( Substitute( Status( CurrentFilePath) , "file://" , "" ) , "/" , "" ) , Status( CurrentFileName) , "" ) &

Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute(

Trim( Substitute( Substitute( Job # , "." , "" ) , "¶" , "" ) ) & "_WO" &

Trim( Substitute( Substitute( WO # , "." , "" ) , "¶" , "" ) ) & "_" &

Trim( Substitute( Substitute( LeftWords( Mat Description , 5 ) , " " , "" ) , "¶" , "" ) ) ,

"," , "" ) , "+" , "" ) , "*" , "" ) , "/" , "-" ) , "^" , "" ) , "&" , "" ) , "=" , "" ) , ">" , "" ) , "<" , "" ) , "(" , "" ) , ")" , "" ) , ";" , "" ) , ":" , "" ) , """" , "" ) , "." , "" ) &

".csv" & """" &

" " & """" & _Folder_Optimizer & """"

Sample output = CMD /C MOVE "C:PRODINFO2499_WO2516_13mmBirchPly.csv" "S:CutRiteV8Import" = “server-sbs01DataCutRiteV8Import”

S: = “server-sbs01Data” Set to reconnect at login.

The difficulty is the file is not consistantly moved to the "S:CutRiteV8Import" folder. I do have greater success if I ensure the FileMaker files are opened via the same path as the destination folder.

Can anyone see anyway to improve this script or calculations?

Is this a common problem using the command line to move over network drives?

You use pre fm7+ Statusfunctions! But this post claims to be 8adv???

However can you export a field content to a path stored in a $variable, and then let you CMD/C shift it's location if you can't get writing permissions to do it straight from filemaker...

  • Author

Sorry, using FMP 5.5 on Windows XP boxes.

At first glance it looks like it should work. But the command line doesn't give you much error trapping, especially for intermittent problems like you're describing.

you may want to move this to a VBscript approach and use the VBscript plugin (www.grokittools.com) to get the feedback into FM so you can handle it.

  • Author

I found the problem today.

When a user opens the file by the network path the address is "server-sbs01" and when a user opens the file by a mapped drive the address is "S:"

I added a test to check for the colon of a drive letter and if false to add "" to the beginning of the file path.

S: = server-sbs01

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.