home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / apmt34.zip / FOLDERS.CMD < prev    next >
OS/2 REXX Batch file  |  1994-07-01  |  2KB  |  48 lines

  1. /******************************************************************/
  2. /* This program lists all the folders on the desktop              */
  3. /******************************************************************/
  4. Trace off
  5. Call RxFuncAdd 'APMTLoadFuncs','APMTEXT','APMTLoadFuncs'
  6. Call APMTLoadFuncs
  7.  
  8. rc=INIT_SESSION();                      If rc\=0 Then Signal stop
  9. signal on halt name close
  10. rc = SELECT_WINDOW("Desktop","5");      If rc\=0 Then Signal stop
  11.  
  12. rc = CONTAINER_QUERY_COUNT(1,"ct");     If rc\=0 Then Signal stop
  13. do i = 1 to ct
  14.   item = "#"||i
  15.   rc = KEYBOARD("\","C");               If rc\=0 Then Signal stop
  16.   rc = CONTAINER_SELECTITEM(1,item);    If rc\=0 Then Signal stop
  17.   rc = KEYBOARD("F10","S");
  18.   rc = POPUPMENU_QUERY_ALL("Open","pb");
  19.   if rc = 0 then do
  20.     if word(pb.2,1) = "~Icon" & word(pb.3,1) = "~Tree " & ,
  21.        word(pb.4,1) = "~Details" then do
  22.        rc = POPUPMENU_SELECT("Open","Settings"); If rc\=0 Then Signal stop
  23.        if rc = 0 then do
  24.          rc = WAIT(4000)                         If rc\=0 Then Signal stop
  25.          rc = SELECT_DIALOGWINDOW("*");          If rc\=0 Then Signal stop
  26.          rc = QUERY_TITLE("title");              If rc\=0 Then Signal stop
  27.          rc = SYSMENU_SELECT("Close");           If rc\=0 Then Signal stop
  28.          rc = LINEOUT("folders.out","Object " i "is a Folder with title "title)
  29.          end
  30.        else rc = LINEOUT("folders.out","Object with title " title "has unexpected menu")
  31.        end
  32.     end
  33.   rc = SELECT_WINDOW("Desktop","50");            If rc\=0 Then Signal stop
  34.   end
  35.   rc = KEYBOARD("ESC");                          If rc\=0 Then Signal stop
  36.  
  37. close:
  38. rc = END_SESSION();
  39. exit
  40. /******************************************************************/
  41. stop:
  42. code=Strip(rc)
  43. Parse Value Sourceline(sigl) With 'rc = ' function ';'
  44. Say 'Return code' code 'from' function 'in line number' sigl
  45. Say '---> 'apmtmsg
  46. rc=END_SESSION()
  47. exit code
  48.