// // Copyright © 2006 Landis R. Fields IV. All rights reserved. // www.LandisFields.com // // - LFmessenger v1.0 - // // This script allows user's to send messages from Maya to anyone within the studio on a standard windows network. // // INSTALLATION: // Place this file into your scripts directory (since this is a windows only script your path should most likely be... // "C:\Documents and Settings\user\My Documents\maya\7.0\scripts\LFmessenger.mel" // // USAGE: // Enter the username of the individual you want to send a message to in the "To" field followed by the message // in the "Message" field and click 'Send'. For more details please refer to the 'Help Screen' in the 'Help' menu. // // PLEASE NOTE: // This script uses window's 'Run' command therefore it does not support other operating systems. // // BASIC PROCEDURE: // When the user clicks the 'Send' button the text within the 'To' and Message' fields is tagged on to the end of the // 'net send' command. If the username of the recipient is used in the 'To' field then the message will be sent to // whatever machine that user is currently logged in to. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // LFmessenger Procedure ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// global proc LFmessenger () { //First we check to see if the LFmessenger interface window exists and if it does then delete it if (`window -q -ex lfmessengerWindow`) deleteUI lfmessengerWindow; //Now that we are sure the LFmessenger interface window does not exist we create one window -title "LFmessenger v1.0" -menuBar true -rtf true lfmessengerWindow; //Create a layout for the LFmessenger interface window columnLayout; frameLayout -bv false -lv false -label "lfFrameLayout"; rowColumnLayout -nc 5 -cw 1 20 -cw 2 70 -cw 3 50 -cw 4 150 -cw 5 70; //Create the 'Help' Menu menu -label "Help"; menuItem -label "Help Screen" -command "LFmessengerHelpScreen"; menuItem -label "About LFmessenger" -command "LFmessengerAbout"; //Create the interface text that reads 'To' in front of the 'To' field text "To:"; //Create the 'To" field. textField lfToField; //Create the interface text that reads Message' in front of the 'Message' field text " Message:"; //Create the 'Message" field textField lfMessageField; //Create the 'Send' button and tell Maya what to do when its pushed button -label "Send" -command "lfSendMessage()"; //Now show the LFmessenger interface window we just created showWindow lfmessengerWindow; } global proc lfSendMessage() { //Query the contents of the 'To' and 'Message' fields and store them in their own variables string $lfTo = `textField -query -text lfToField`; string $lfMessage = `textField -query -text lfMessageField`; //Create a variable to store the contents of the 'To' and 'Message' fields string $lfMessageToBeSent; //Combine the variables that store the contents of the 'To' and 'Message' fields $lfMessageToBeSent = ("net send" + " " + $lfTo + " " + $lfMessage); //Use the combined fields with the 'net send' command to send the message system ($lfMessageToBeSent); //Clear the 'Message" field textField -edit -text "" lfMessageField; } global proc LFmessengerHelpScreen() { //First we check to see if the LFmessenger 'Help Screen' window exists and if it does then delete it if (`window -q -ex lfHelpScreenWindow`) deleteUI lfHelpScreenWindow; //Now that we are sure the LFmessenger 'Help Screen' window does not exist we create one window -title "LFmessenger v1.0 - Help Screen" -width 500 -height 630 -rtf true lfHelpScreenWindow; //Create a layout for the LFmessenger 'Help Screen' window scrollLayout -width 500 -height 630 -horizontalScrollBarThickness 0 -verticalScrollBarThickness 16; //Create the 'Help Screen' text text " \n - LFmessenger v1.0 - \n Help Screen \n LF Messenger \n \n LF Messenger allows users to send messages to other users, computers, or messaging names within \n the studio on a standard windows network.The recipient does not need to have Maya installed or \n running in order to recieve messages sent from LF Messenger. \n \n \n To \n \n Specifies the user name, computer name, or messaging name to which you want to send the \n message. Use the wild card symbol * in the 'To' field to send a message to all the names in your \n studio/domain/workgroup (use discretion when you send messages to multiple users). \n \n \n Message \n \n Specifies the text or 'body' of the message.\n \n \n You can send a message only to a name that is active on the network. If you send the message to \n a user name, that user must be logged on and running the Messenger service to receive the \n message. The Messenger service within Windows must be running for messages to be received. \n \n \n How to start the messenger service within windows \n \n You must be logged on as an administrator or a member of the Administrators group in order to \n start/stop services within Windows. If your computer is connected to a network, network policy \n settings might also prevent you from doing so.\n \n 1. Click Start, point to Settings, and then click Control Panel. \n 2. Double-click Administrative Tools, and then double-click Services. \n 3. In the details panel, do one of the following: \n - Select the service. On the Action menu, click Start, Stop, Pause, Resume, or Restart. \n - Right-click the service, and then click Start, Stop, Pause, Resume, or Restart. \n \n \n Important \n \n If you stop, start, or restart a service, any dependent services are also affected. Changing the \n default service settings might prevent key services from running correctly. It is especially important \n to use caution when changing the Startup Type and Log On As settings of services that are \n configured to start automatically. "; //Now show the LFmessenger 'Help Screen' window we just created showWindow lfHelpScreenWindow; } global proc LFmessengerAbout() { //First we check to see if the LFmessenger 'About' window exists and if it does then delete it if (`window -q -ex lfAboutWindow`) deleteUI lfAboutWindow; //Now that we are sure the LFmessenger 'About' window does not exist we create one window -title "LFmessenger v1.0 - About" -titleBar false -rtf true lfAboutWindow; //Next we adjust size of the LFmessenger 'About' window for cosmetic reasons window -edit -wh 200 100 lfAboutWindow; //Create a layout for the LFmessenger 'About' window columnLayout -width 500 -height 100 -columnAlign "center"; //Create the 'About' text text "\n - LFmessenger v1.0 - \n \n Copyright © 2006 Landis R. Fields IV. All rights reserved.\n\n www.LandisFields.com \n \n "; //Create the 'Ok' button and tell Maya what to do when its pushed button -align "center" -label "OK" -width 50 -height 20 -command "deleteUI lfAboutWindow"; //Now show the LFmessenger 'About' window we just created showWindow lfAboutWindow; }