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.

Windows OS Equivalent to Perform AppleScript Script Step

Featured Replies

We currently run FileMaker Server Advanced 11 on Mac OS X server.  We will be making the move to FMS 13 in the next 6 months and are exploring the option of moving our FMS to our Windows virtual server farm.   We use the AppleScript script step in a few of our solutions to run shell scripts and modify text files in the OS on the server.  I am struggling to find an equivalent method for the Windows side.  Below are a couple of examples of what we currently do.  My hope is someone here can post an explanation with examples to get us off and running.   

 

#Add header to export file and convert to Windows CRLF
Perform AppleScript
   [ Native AppleScript: 
 
--Add header row
do shell script "perl -i -lne 'if($.==1){print "uidNumbertgidNumbertSamAccountNametPasswordtSurNametGivenNametEmailAddresstHomeDirectorytadPathtLocaleIDtphysicalDeliveryOfficeNametUpdateFlagr$_"}else{print}' ~/Desktop/AD_Account_Info.txt" 
 
--Convert from Mac to Windows line breaks
do shell script "perl -i -pe 's/015/015012/g' ~/Desktop/AD_Account_Info.txt"
   ]
 
#Add Date & Time Stamp to file name
Set Variable [ $DateTimeStamp; <calculation redacted 'cause it's gnarly> ]
 
Perform AppleScript
   [ Calculated AppleScript:
"do shell script "mv ~/Desktop/AD_Account_Info.txt ~/Desktop/AD_Account_Info_" & $DateTimeStamp & ".txt""
   ]
 
Regards,
Darrin

There is no matching equivalent (as in "Perform Windows Script" in the Windows version.  The closest you can get (without a plugin) is the Send Event script step.  Send Event can open any document or run any application.  

 

Simple commands can be sent directly to the command line interpreter like this:

cmd /c <do something here> && <do something else here> && <and one more command>

 

More complex stuff requires you to generate a batch file, VBscript or PowerShell file (can be exported from FM, they are just text files with the proper extension), and then called through Send Event.  Since you can generate those files from inside FM they are completely dynamic based on your data.


Obviously, if the OS script is fairly static you can also just write the script, save it in the FMS scripts folder and use a "Script Sequence" schedule that consist of two parts:

- runs your FM script that does the export

- runs the OS script that converts the line endings

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.