When sending a message to HubNet clients using hubnet-broadcast-message or hubnet-send-message a newline is added. This does not happen when broadcasting a message using the HubNet Control Center.
Example:
hubnet-broadcast-message "test"
hubnet-broadcast-message "test2"
Shows in the clients as:
test
test2
(*another newline here*)
The Broadcast Message option in Hubnet Control Center gives:
3:28:19 <Leader> test
3:28:21 <Leader> test2
My question is how do I broadcast a message from my code without the added newline? Currently only the last message is visible to the clients due to the newline.
Related
I have written - with the help of various sources of course -, this script to redirect mail in bulk: it redirects all mail selected in the mail app. There seems to be nothing special going on.
tell application "Mail"
set AppleScript's text item delimiters to ""
set theRedirectRecipient to "redirectmail#mail.mail"
set theRedirectSender to "Sender"
set theMessages to the selection
repeat with thisMessage in theMessages
tell application "Mail"
set theRedirectedEmail to redirect thisMessage with opening window
tell theRedirectedEmail
if subject of thisMessage is "" then
set subject of theRedirectedEmail to "Mails zonder subject"
end if
make new to recipient at beginning of to recipients with properties {address:theRedirectRecipient}
#delete bcc recipients
#delete cc recipients
end tell
#delay 2
#send theRedirectedEmail
end tell
end repeat
end tell
As above, the script runs fine: it creates the redirect mail, and if I press the send button, it works like I need it to.
But there are 3 lines commented out that do not work. The delete lines and the send line. I'm not really sure I care about the delete ones, but I have included them in case someone can see a pattern.
Uncommenting one of those lines gives me this error:
error "Mail got an error: Can’t get every cc recipient of outgoing
message id 18." number -1728 from every cc recipient of outgoing
message id 18
Again, this does create a message-window that I can send successfully if done by hand.
Uncommenting the 'send' line introduces the following error:
error "Mail got an error: outgoing message id 19 doesn’t understand
the “send” message." number -1708 from outgoing message id 19
So what I have concluded is that the created message doesn't behave as a message 'should'. I have seen this thread about an 'outgoing message' that seems to display this behaviour.
What is going on with this message called theRedirectEmail? How can I send messages to this object, like delete and send?
I noticed this same issue. Here's the workaround I came up with. In some ways, it's actually easier:
tell application "Mail"
set AppleScript's text item delimiters to ""
set theRedirectRecipient to "redirectmail#mail.mail"
set theRedirectSender to "Sender"
set theMessages to the selection
repeat with thisMessage in theMessages
redirect thisMessage with opening window
tell application "System Events"
tell application process "Mail"
tell window 1
--wait for mail message to appear before continuing
repeat while not (text field "To:" exists)
end repeat
set value of text field "To:" to theRedirectRecipient
set value of text field "Cc:" to ""
if text field "Bcc:" exists then
set value of text field "Bcc:" to ""
end if
if value of text field "Subject:" is equal to "" then
set value of text field "Subject:" to "Mails zonder subject"
end if
end tell
tell application "Mail" to activate
click menu item "Send" of menu 1 of menu bar item "Message" of menu bar 1
end tell
end tell
end repeat
end tell
You have to tell Mail to activate, because Mail doesn't allow the sending of email when it's in the background, probably to prevent evil-doers from spamming your entire contacts list in the background, without your knowledge, using AppleScript. This may be related to the strange behavior of mail regarding outgoing messages too, though I can't be sure...
I am trying to use a gmail account in Mutt 1.5.3 on OS X, installed through brew. Using s and navigating to 'All Mail', I can manually save files from my inbox to the all mail folder, but the process is annoyingly manual. I have tried to define a macro to help make this easier.
macro index,pager \CA '<save-message>=[GMAIL]/All\ Mail<enter>'
This macro works in the sense that pressing ctrl-A causes it to fire, and it does ask me if I want to move my messages ... unfortunately it gets the destination wrong. it asks if I want to move the message to 'All' or 'All\Mail'. Somehow the space is completely ignored. I know that the destination folder proposed by the macro is indeed not 'All Mail' (rather than being a bug in the modeline) because mutt prompts me on whether to create the folder or not.
Credit: https://stackoverflow.com/a/14779416/931154
You can escape a literal space using %20. Also, in order to back up your message to your online All Mail folder, the following macro should be used.
macro index,pager \CA "<save-message>=[Gmail]/All%20Mail<enter>"
[Key Mappings of New Media Remote]
http://i.stack.imgur.com/ivMSK.png
Using AutoHotkey I want to interrupt Keyboard Keys sent like AppsKey and Browser_Home and send another key instead. Unfortanately the best I can manage is to send a key as well as the key function.
F3::SendInput {a}
Browser_Home::SendInput {a}
Browser_Home::SendInput a
Browser_Home:: a
The first line 'F3 to a' works as intended; the F3 Key outputs the letter a.
The 2nd and 3rd line Browser_Home only launches Browser to Home.
The 4rd line launches the Browser_Home as well as outputting the letter a.
Anyone know what I'm doing wrong / know how to fix my script to output a without launching browser to home?
According to documentation under Hotkey:
$ is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise
cause it to trigger itself. The $ prefix forces the keyboard hook to
be used to implement this hotkey, which as a side-effect prevents the
Send command from triggering it. The $ prefix is equivalent to having
specified #UseHook somewhere above the definition of this hotkey
Try this and report back: $Browser_Home::SendInput {a}
When running a progress-4gl program, I am able to write to a log file using the log-manager. However, when writing out message statements they only appear when I use message view-as alert-box. ie:
log-manager:logfile-name = "queue.p"
message "this will not appear".
message "this will appear" view-as alert-box.
Will show up in the log file as:
[12/05/10#09:03:21.154-0700] P-11993170 T-000001 1 4GL -- this will appear
Is there any way I can force the log-manager to write out message statements that do not include view-as alert-box? Our legacy code uses the message statement everywhere and I would prefer to not have to go through all related libraries updating it.
I fear getting messages (without "VIEW-AS ALERT-BOX") to the clientlog file is not possible.
Progress help says: "OpenEdge writes all ABL VIEW-AS ALERT-BOX messages to the log file".
(LOG-ENTRY-TYPES attribute > 4GLMessages).
Are you thinking of something like the LOG-MANAGER:WRITE-MESSAGE( ) method?
you should use in this case a Batch startup parameter. -b
then will no messages displayed (except errors).
prowin32.exe -p c:\test.p -b
you can define, where should be the messages logged. then will not displayed the errors too.
for example:
prowin32.exe -p c:\test.p -b > c:\Test.txt
Before all of my messages were in one maildir. Now I want move all arch-general mail to another one.
From here, I see:
"move" as we know it from other places is "save" in mutt.
"save" as we know it from other places is "copy" in mutt.
~e EXPR message which contains EXPR in the ``Sender'' field
so I use pattern in index
'T' and '~e arch-general' then 's'
but just one message moved.
How can I move all pattterned messages to another dir?
;s
; tag-prefix apply next function to tagged messages