uses rfScriptEnv, System, Classes, Sysutils; procedure RefreshAndFXPManyTimes(Sender); begin RushApp.UI.Selection.Prepare; if RushApp.UI.Selection.CanFXP and (RushApp.UI.Selection.Count=1) then begin if RushApp.UI.Selection.Items[0].IsFolder then RushApp.UI.Selection.MakeFXPQueue( RushApp.UI.Selection.FtpID, RushApp.UI.Selection.FtpPath, RushApp.UI.Selection.Items[0].Name, RushApp.UI.Selection.TargetFtpID, RushApp.UI.Selection.TargetFtpPath, RushApp.UI.Selection.Items[0].Name, RushApp.UI.Selection.Items[0].Size, RushApp.UI.Selection.Items[0].IsFolder, RushApp.UI.Selection.IsLeftSide, True, RushApp.UI.Selection.FtpName +' to ' + RushApp.UI.Selection.TargetFtpName, 600, '([^\w]*100%[^\w]*)|([^\w]*-\sCOMPLETE\s\)[^\w]*)|([^\w]*-\sCOMPLETE\s-[^\w]*)|(\.(jpg)$)' ); end; end; procedure OnCallExternalProgramClick(Sender); begin RushApp.UI.Selection.Prepare; if RushApp.UI.Selection.IsLocalSide and (RushApp.UI.Selection.Count>0) then begin ShowMessage(RushApp.UI.Selection.Items[0].FullPath); end else ShowMessage('doh!'); end; procedure UnpackRAR(Sender); begin RushApp.UI.Selection.Prepare; if RushApp.UI.Selection.IsLocalSide and (RushApp.UI.Selection.Count>0) then begin ShellExecuteCommand('unrar.exe','unrar x -ad '+'"'+RushApp.UI.Selection.Items[0].FullPath+'"',RushApp.UI.Selection.LocalPath,''); end else ShowMessage('Bad News!'); end; procedure OnSwitchlayout(Sender); begin RushApp.UI.Menu.Local.Add('RAR...','UnpackRAR',5,'Alt+F9').OnClick :='UnpackRAR'; RushApp.UI.Bar.StatusBar.SumWindowButton.Visible := False; RushApp.UI.Bar.StatusBar.SumTransferButton.Visible := False; RushApp.UI.Bar.StatusBar.SumConnectedButton.Visible := False; RushApp.UI.Bar.StatusBar.ProgressItem.Width := 240; RushApp.UI.Menu.Local.Add('Misc.','Call External App...',5,'Ctrl+F12').OnClick :='OnCallExternalProgramClick'; RushApp.UI.Menu.Remote.Add('', 'FXP it 600 times',2,'CTRL+T').OnClick :='RefreshAndFXPManyTimes'; end; //Entry point !!! begin RushApp.UI.OnSwitchLayout := 'OnSwitchlayout'; end;