home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / newurl.zip / createurlobj.cmd next >
OS/2 REXX Batch file  |  1996-10-27  |  2KB  |  41 lines

  1. /*************************************************************/
  2. /*                                                           */
  3. /* createnewurl.cmd                                          */
  4. /*                                                           */
  5. /* Script that creates a Warp4 URL object in a "New URL's    */
  6. /* desktop folder (once created, the folder can be moved     */
  7. /* anywhere, since it's object ID is used.) Used by          */
  8. /* newurl.cmd for creating URL object, but can be called by  */
  9. /* any other program. Note that an URL looking like:         */
  10. /* http://address must actually be called like "http address */
  11. /* since // for some reason trunkates the parsed argument    */
  12. /* list.                                                     */
  13. /*                                                           */
  14. /* Copyright (C) 1996 Bjorn Fahller                          */
  15. /*                                                           */
  16. /*************************************************************/
  17.  
  18. parse arg type address;
  19.  
  20. url=type||'://'||address;
  21.  
  22. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  23. call SysLoadFuncs
  24.  
  25.  
  26. result = SysOpenObject("<BF_NEWURLS>","ICON", 0);
  27. if result == 0 then
  28.   do
  29.      result = SysCreateobject("WPFolder","New URL's","<WP_DESKTOP>","OBJECTID=<BF_NEWURLS>");
  30.      if result == 0 then
  31.        exit 1;
  32.      result = SysOpenObject("<BF_NEWURLS>","ICON", 0);
  33.      if result == 0 then
  34.        exit 1;
  35.   end
  36.  
  37.  
  38. result=SysCreateObject("WPUrl",url,"<BF_NEWURLS>","URL="url);
  39.  
  40. exit 0;
  41.