procedure XRelNfoAction(action); var oDir, allowDirStr, tempPath, scriptPath; begin tempPath := 'C:\temp'; scriptPath := 'C:\temp\xrelrush.vbs'; RushApp.UI.Selection.Prepare; if (RushApp.UI.Selection.IsRemoteSide) and (RushApp.UI.Selection.Count > 0) and (RushApp.UI.Selection.IsFTPConnected) then begin allowDirStr := ''; for i := 0 to RushApp.UI.Selection.Count - 1 do begin oDir := RushApp.UI.Selection.Items[i]; if not oDir.IsFolder then begin ShowMessage('You have to use this on a release dir!'); end else if not MatchExpr(oDir.Name, '^[a-z0-9()._-]{5,}$') then begin ShowMessage('"' + oDir.Name + '" is not a valid release name!'); end else begin if (i > 0) then allowDirStr := allowDirStr + ';'; allowDirStr := allowDirStr + oDir.Name; end; end; if allowDirStr <> '' then begin RushApp.FTP.Transfer(0, { src ftp } RushApp.UI.Selection.FTPName, { src folder } RushApp.UI.Selection.FtpPath, { src item } '', { dest ftp } '', { dest folder } tempPath, { dest item } '', { flags } RS_DOWN or RS_DIRSRC or RS_DIRDES or RS_APPEND or RS_NOCIRCLE, { folderAllow } allowDirStr, { folderSkip } '', { fileAllow } '*.nfo', { fileSkip } '', { completeFlag } '', { repeatCount } 0, { retryCount } 0, { timeout } 0, { folderSort } 0, { fileSort } 0, { depth } 0, { subCount } 0); ShellExecuteCommand('', 'C:\windows\system32\wscript.exe "' + scriptPath + '" ' + action + ' "' + tempPath + '" "' + allowDirStr + '"', '', 0); end; end; end; procedure PostNfoToXRel(Sender); begin XRelNfoAction('post'); end; procedure DownAndViewNfo(Sender); begin XRelNfoAction('view'); end;