What is wrong with this ? 5.OS4.1FE:> RX "address YAM; setmailfile 'Stock:Internet/YAM_2.10/Folders/SJ7A2AAFF7A=.001' " 1 *-* setmailfile 'Stock:Internet/YAM_2.10/Folders/SJ7A2AAFF... +++ Command returned 10
Don't supply a path, it is just stripped. The mail with the given filename is expected to be in the current folder and is set as current there (if I understand it correctly).
in fact my path was incomplete, but i still have the same error code. Using only the file name (and verifying the current folder indeed is "Ermias") I have this.
In fact i was reanimating an old script (YAM2.4) that did not work any more with YAM2.10 I was suspicious of the "=" now appearing in the file names, but that should be taken care of with the single quotes in the command, isn't it?
Could you check if setmailfile is working for you?
I was able to make the setmailfile command work via the Gui4Cli sendrexx command. It does not work for me however with the RX command or in a arexx script.
I had to set the folder before setting the file. Notice the ' and the " surrounding the file name.
It doesn't work in a one-line script but I think that's more of an ARexx issue than a YAM issue. There doesn't seem to be any way to ESCAPE the double quotes in a one-line ARexx script but maybe an ARexx expert knows how to do it.
Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450
I don't know if quotes are needed around the folder name, but I put them there because usually without them, it'd treat the word Storage as a variable. I also didn't see SETFOLDER used on a single-line example, so perhaps you could try with 'NTwafgAF7bg=.001,R' after setting the folder.
The rule is that for whatever type of quote you start with, if you want to use that same type of quote inside the variable itself, then you escape it with itself.
Like with Var = 'Doesn''t'. It's easier to use Var = "Doesn't"
Or you can use d2c(number) as well if that's easier to understand. Var = 'Doesn'd2c(39)'t'
Notice the single quotes are round the entire command, this mnake is much easier to remeber that ARExx commands are entire strings sent to the function host.
In a previous post i was wondering if there was a bug in YAM's arexx port.
The posted code (and errors reported) did point me to the source of the errors after you address YAM and do a 'Mailinfo STEM' mi.
you get an error for any address info (mi.from, mi.to , mi.resentto, ...) when you send the DOS command 'SetEnv .Yfrom' mi.from => "Unable to open redirection file" this is because mi.from is a string containing sharp brackets ( eg Sender Jo <senderjo@telenet.be>)
I did not succeed in "quoting" the string to make SetEnv accept the string. Can this be done?
I used a function
repbraces: a = arg(1) n = pos("<",a)
s = delstr(a,n,1) s = insert("[",s,n-1,1) n = pos(">",s) s = delstr(s,n,1) s = insert("]",s,n-1,1) return s
you get an error for any address info (mi.from, mi.to , mi.resentto, ...) when you send the DOS command 'SetEnv .Yfrom' mi.from => "Unable to open redirection file" this is because mi.from is a string containing sharp brackets ( eg Sender Jo <senderjo@telenet.be>)
I would have thought something like:
'SetEnv .Yfrom "' || mi.from || '"'
- would do it? (I haven't tried it, though.)
But just in case, I'd probably remove the dot in front of the env var name.
I encounterd an other problem with the ADDRINFO arexx command An example script is given here http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO The exapmle does not work for me (after changing the ALIAS to 'Liesl' which is an existing entry in my .addressbook file
I completed the script as below and noted the resulting trace for the different ADDRINFO lines i used. Not one is working including the origial (edited line) Is this only here?
/* _AddrInfo.yam Test of
ADDRINFO VAR/K,STEM/K,ALIAS/A
*/
OPTIONS RESULTS
/* Ignore possible error from ADDRINFO */
OPTIONS FAILAT 11
/*PARSE ARG HALIAS*/
ADDRESS YAM
ADDRLOAD 'YAM:.addressbook' OPEN
n = "Liesl"
/* Find a given entry */
/* ADDRGOTO 'Liesl' // added noeffect */
/*ADDRINFO 'mars' STEM st. // original example */
ADDRINFO 'Liesl' STEM st. /* "ADDRINFO Liesl STEM ST." nok*/
/* ADDRINFO "Liesl" STEM st. // "ADDRINFO Liesl STEM ST." nok*/
/*'ADDRINFO "'n'"' STEM st. // "ADDRINFO "Liesl" STEM ST." nok*/
/* 'ADDRINFO ' || n STEM st. // "ADDRINFO Liesl STEM ST." */
n = '"'n'"'
say n
/*'ADDRINFO ' || n STEM s //"ADDRINFO "Liesl" STEM ST."*/
/* Only continue if RC == 0 */
SAY 'RC is' RC
IF RC ~= 0 THEN EXIT
/* List results */
SAY 'Type of entry: 'st.type /* ST.TYPE */
SAY 'Real name: 'st.name
SAY 'Email address: 'st.email
SAY 'PGP key ID: 'st.pgp
SAY 'Homepage: 'st.homepage
SAY 'Street: 'st.street
SAY 'City: 'st.city
SAY 'Country: 'st.country
SAY 'Phone #: 'st.phone
SAY 'Description: 'st.comment
SAY 'Date of birth: 'st.birthdate
SAY 'Portrait: 'st.image
@Elwood Thanks that is a usefull reminder i am not not sure however on what post you are replying, i guess the latest and this is a suggestion to replace the
IF RC ~= 0 THEN EXIT line.
This is not the problem right now; Did you note i was not longer testing the MAILINFO or SETMAILFILE : i can use both of them now. This is not the case with ADDRINFO.
This command has as template ADDRINFO VAR/K,STEM/K,ALIAS/A and whatever i try it fails. (see all alternative used in the latest script and the given reference script http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO
from which it was derived. In fact i think since we have the command ADDRGOTO ALIAS/A
a simpler command ADDR_INFO VAR/K,STEM/K, might do.
Before reporting my problems as a bug or suggesting this simpler command to the YAM authors i want to be sure others observe the same difficulty with the ADDRINFO command.
@JosDuchIt I copied the example at http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO and added "ADDRESS YAM" below the "OPTIONS FAILAT 11" line. I changed the name in the ADDRINFO line and ran the script from a shell. It worked and printed the available information. However, I'm still using YAM 2.7 which may not help if you're using a more recent version of YAM.
It might be helpful if someone using the latest YAM release could test the example script for you.
Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450