Changes between Initial Version and Version 1 of es:FAQ/ARexx Scripting


Ignore:
Timestamp:
Sep 22, 2014, 11:21:22 PM (6 years ago)
Author:
Emilio Jimenez
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • es:FAQ/ARexx Scripting

    v1 v1  
     1[[TranslatedPages]]
     2[[TOC(titleindex, heading=FAQ Contents, notitle, depth=2, FAQ/General Questions, FAQ/Installing YAM, FAQ/Using YAM, FAQ/ARexx Scripting, FAQ/Debugging)]]
     3
     4= [wiki:"ARexx Scripting" ARexx Scripting] =
     5[[PageOutline(2-6,,inline)]]
     6
     7== The "WRITEEDITOR TEXT" arexx command doesn't seem to work? ==
     8If you are having trouble getting the WRITEEDITOR TEXT arexx command to work as expected and your script always returns an error similar to that one:
     9
     10{{{#!arexx
     111 *-* WRITEDITOR TEXT Hello World
     12+++ Command returned 10
     13}}}
     14
     15then chances are high that you simply missunderstood or missread the documentation about the WRITEEDITOR command in the YAM amigaguide documentation. So please note that using the TEXT attribute of the WRITEEDITOR command implies to take care of a special text quoting as otherwise YAM isn't able to identfy what the attribute and what the actual text is you supplied to the WRITEEDITOR arexx command.
     16
     17For example, if you want to put the text "Hello World!" into an already opened write window in YAM you are ought to have you arexx script designed like:
     18
     19{{{#!arexx
     20/* My script */
     21ADDRESS YAM
     22MAILWRITE WINDOW 0
     23'WRITEEDITOR "TEXT Hello World!"'
     24}}}
     25
     26Please take special attention on the used quotating marks (' and ") used on the WRITEEDITOR command. Any other combination of these quotation marks will actually result in the WRITEEDITOR command to return the above mentioned error. However, if you want to just issue the e.g. CLEAR attribute you can also simply use "WRITEEDITOR CLEAR" without any quotating marks. The special quotation is only required for the TEXT attribute.
     27
     28== The GotoURL.yam Arexx script doesn't seem to work and popup my webbrowser if I doubleclick on an URL. Why? ==
     29The included GotoURL.yam Arexx script might fail due to several possible reasons.
     30
     31First of all, we have to mention that due to the direct integration of the openurl.library in YAM 2.4+, the Arexx script is somewhat considered obsolete. The same behaviour/functionality can now be achieved by installen the OpenURL library and its tools. So, we highly recommand to install the openurl.library instead and disable the use of the GotoURL.yam script in your YAM->Arexx configuration.
     32
     33However, if you still want to continue to use the GotoURL.yam arexx script there are several things you have to consider and eventually modify the arexx script directly:
     34
     35* Several parameters within the GotoURL.yam script have to be changed and adapted to your own environment. This includes the correct path to the webbrowser you want to get started as soon as you double-click on an URL
     36* Since YAM 2.5+, the way Arexx scripts are executed is slightly changed. In fact, former versions did automatically supply the script the full path to the URL when executing. Since YAM 2.5+ you have to make sure that within the Arexx configuration you supply the script the necessary URL replacement substitution string (%p).
     37
     38== Why can't I send newline characters (0x0a) via the WRITEEDITOR Arexx command to YAM? ==
     39You can. But you have to escape such special characters like a newline or an escape (0x1b) character with some special char sequences like:
     40
     41{{{
     42 *N subsitutes to a newline (0x0a)
     43 *E subsitutes to a esc char (0x1b)
     44 ** subsitutes to a *
     45 *" subsitutes to a "
     46}}}
     47
     48For example the following command would write a string to a texteditor containing a newline:
     49
     50{{{#!arexx
     51'WRITEEDITOR "TEXT Hello Joe,*N I would like to meet you."'
     52}}}
     53
     54Please note that this applies to all Arexx command arguments and that you have to use proper escape sequences like explained above.