Skip to content

Instantly share code, notes, and snippets.

@petrowsky
Created June 16, 2016 17:45
Show Gist options
  • Save petrowsky/9c1a3356eef5aa6d60c03e6a523561d2 to your computer and use it in GitHub Desktop.
Save petrowsky/9c1a3356eef5aa6d60c03e6a523561d2 to your computer and use it in GitHub Desktop.
Let ( [
~now = Get ( CurrentTimestamp );
~useTimeStamp = Get ( ActiveModifierKeys ) = 8 or Get ( ActiveModifierKeys ) = 10;
~registered = MBS ( "Register"; "Name Here"; "Complete"; "5 seats" ; 201601 ; -12831001) = "OK";
~targetFolder = MBS ( "Folders.UserDesktop" )
& "/DDR/"
& Filter ( Get ( FileName ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklomnopqrstuvwxyz1234567890" )
& If ( ~useTimeStamp ;
"_" & Year ( ~now )
& "-" & Right ( "0" & Month ( ~now ) ; 2 )
& "-" & Right ( "0" & Day ( ~now ) ; 2 )
& "_" & Right ( "0" & Hour ( ~now ) ; 2 )
& "." & Right ( "0" & Minute ( ~now ) ; 2 )
& "." & Right ( "0" & Seconds ( ~now ) ; 2 )
);
~doesFolderExist = MBS( "Files.DirectoryExists"; ~targetFolder );
~makeFolderIfNecessary = Case(
~doesFolderExist;
0;
MBS ( "Files.CreateDirectory"; ~targetFolder )
)
];
If ( ~registered ; MBS ( "FM.RunDataDesignReport" ; 1 ; ~targetFolder ) ; "MBS Plug-in not registered" )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment