« More Toolbar Tools - Toolbar Functions | Main| @UpdateFormulaContext and @Command([Compose]) »

Toolbar Functions 1.1

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

Updated version of Toolbar Functions is now available.

Johan Känngård asked for the ability to remeber that last function used so here it is. I also added a three more options

Here are the current options:
  • Undo Replication Conflict
  • Unlock Document
  • Refresh Selected Documents
  • Link Message
  • Workflow Formula Test
  • Agent Run
  • Agent Run Current
  • Get Notes ID
  • Get UNID
  • Get Parent UNID
  • Edit Profile Document
  • Get Environment Value
  • Set Environment Value

REM {Toolbar Functions by Chad Schelfhout.};
REM {Visit http://www.chadsmiley.com/ToolbarFunctions for the latest updates};

REM {Constants};
ToolbarToolsLastSelection := "ToolbarToolsLastSelection";
ToolbarToolsLastProfile := "ToolbarToolsLastProfile";
ToolbarToolsLastEnvironmentVariable := "ToolbarToolsLastEnvironmentVariable";;
ProfileName := "ChadSmiley Tools";
DefaultSelection := "Undo Replication Conflict";

REM {Get last selection for this database};
ToolbarToolsSelection := @GetProfileField( ProfileName ; ToolbarToolsLastSelection ; @UserName ) ;

Option := @Prompt( [OkCancelCombo] ; "Select Option" ; "What would you like to do:" ; @If( ToolbarToolsSelection = "" ; DefaultSelection ; ToolbarToolsSelection ) ; @Explode( "Undo Replication Conflict:Unlock Document:Refresh Selected Documents:Link Message:Workflow Formula Test:Agent Run:Agent Run Current:Get Notes ID:Get UNID:Get Parent UNID:Edit Profile Document:Get Environment Value:Set Environment Value"  ; ":" ) ) ;

REM {Set last selection for this database};
@SetProfileField( ProfileName ; ToolbarToolsLastSelection ; Option ; @UserName ) ;

@If( Option = "Refresh Selected Documents" ; @Command([ToolsRefreshSelectedDocs])  ; "") ;

@If( Option = "Undo Replication Conflict" ; @Do( @SetField("$REF" ; @DeleteField ) : @SetField( "$Conflict" ; @DeleteField ) ) ;

Option = "Unlock Document" ; @Do( @SetField("$Writers" ; @DeleteField ) : @SetField( "$WritersDate" ; @DeleteField ) ) ;

Option = "Agent Run" ; @Do ( @Command([RunAgent] ; @Prompt( [OkCancelEdit];"Run Agent" ; "Enter agent to run"; "" ) ) ) ;

Option = "Agent Run Current" ; @Do ( @Command([ToolsRunMacro]; $Title) ) ;

Option = "Link Message" ; @Do ( @Command([Compose]; @MailDbName; "Bookmark") ) ;

Option = "Edit Profile Document" ; @Do (
   @SetProfileField( ProfileName ; ToolbarToolsLastProfile ; @Prompt([OkCancelEdit]; "Open Profile Document"; "Profile Document Name (There should be a corresponding form or suborm)"; @GetProfileField( ProfileName ; ToolbarToolsLastProfile ; @UserName ) ) ; @UserName ) :
   @Command([EditProfile] ; @GetProfileField( ProfileName ; ToolbarToolsLastProfile ; @UserName ) ; @If( @Prompt( [YesNo] ; "Personal Profile" ; "Is this a personal profile?" ) ; @UserName ; "" ) ) ) ;

Option = "Get Environment Value" ; @Do (
   CurrentEnvVariable := @GetProfileField( ProfileName ; ToolbarToolsLastEnvironmentVariable ; @UserName ) ) :
   @Set( "NewEnvVariable" ; @Prompt([OkCancelEdit]; "Get Environment Value"; "Enter the name of the environment variable:"; CurrentEnvVariable ) ) :
   @SetProfileField( ProfileName ; ToolbarToolsLastEnvironmentVariable ; NewEnvVariable ; @UserName ) :
   @Prompt([OkCancelEdit]; "Environment Value"; "The value of the evironment variable '" + NewEnvVariable +  "':"  ;  @Environment( NewEnvVariable ) );

Option = "Set Environment Value" ; @Do (
   CurrentEnvVariable := @GetProfileField( ProfileName ; ToolbarToolsLastEnvironmentVariable ; @UserName ) ) :
   @Set( "NewEnvVariable" ; @Prompt([OkCancelEdit]; "Set Environment Value"; "Enter the name of the environment variable:"; CurrentEnvVariable ) ) :
@Prompt( [ok]; "hi" ; NewEnvVariable ):
   @SetProfileField( ProfileName ; ToolbarToolsLastEnvironmentVariable ; NewEnvVariable ; @UserName ) :
   @SetEnvironment( NewEnvVariable ; @Prompt([OkCancelEdit]; "Environment Value"; "The new value of the evironment variable '" + NewEnvVariable +  "':"  ;  @Environment( NewEnvVariable ) ) );

Option = "Get Parent UNID" ; @Do ( @Prompt([OkCancelEdit]; "Parent UNID"; "Parent Unique ID"; @Text($REF)) ) ;

Option = "Get UNID" ; @Do ( @Prompt([OkCancelEdit]; "UNID"; "Unique ID"; @Text(@DocumentUniqueID)) ) ;

Option = "Get Notes ID" ; @Do ( @Prompt([OkCancelEdit]; "NoteID"; "NoteID"; @Text(@NoteID))  ) ;

Option = "Workflow Formula Test" ; @Do ( @Command([Compose]; @DbName; "(OS FormulaTest)") ) ;

"" );

Comments

1 - Nice work! Thanks!

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)