Can't send ascii>001
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am
Can't send ascii>001
I'm in the early throws of creating a macro to interact with "Remedy" the companies ticketing system.
I can't have direct access to the remedy database so I either have to tab from field to field entering data which is slow, (as the front end is a joke), or I can get Macro scheduler to write a simple text file which will be saved as a "remedy macro" essentially opening a ticket with all the details filled in, saving about a minute for each ticket raised.
Hope you are still with me.
The problem is, looking at macros created by remedy there is a character that appears in the text file.
It looks like SOH and appears to be the character represented by ascii>1 When I get MS to putascii>1 into notepad (with the fonts set so I should see the character), I get nothing.
I created a little script to write all ascii characters from 1-1000 in notepad, hoping to see it in the list... nope,
I tried copying the character then pasting it into a MS script ...nope.
Any ideas guys ?
Need more info ?
Thanks in advance.
I can't have direct access to the remedy database so I either have to tab from field to field entering data which is slow, (as the front end is a joke), or I can get Macro scheduler to write a simple text file which will be saved as a "remedy macro" essentially opening a ticket with all the details filled in, saving about a minute for each ticket raised.
Hope you are still with me.
The problem is, looking at macros created by remedy there is a character that appears in the text file.
It looks like SOH and appears to be the character represented by ascii>1 When I get MS to putascii>1 into notepad (with the fonts set so I should see the character), I get nothing.
I created a little script to write all ascii characters from 1-1000 in notepad, hoping to see it in the list... nope,
I tried copying the character then pasting it into a MS script ...nope.
Any ideas guys ?
Need more info ?
Thanks in advance.
don't be a chicken little
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am
If I change the font of notepad I can actually see the characters as I say, it looks like SOH written in small letters diagonally down from left to right. I can view it I can copy and paste it around within notepad.... but I can't create one from scratch, and I can't get MS to write one.
Thanks for the reply.
Thanks for the reply.
don't be a chicken little
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, sounds like Ascii code 1. Have verified this with Boxer Text Editor. I can't send it to Notepad, but sending it to Boxer works:
SetFocus>Boxer*
Ascii>1
Boxer has a nice Ansi character chart feature which shows this character and others.
http://www.boxersoftware.com/
SetFocus>Boxer*
Ascii>1
Boxer has a nice Ansi character chart feature which shows this character and others.
http://www.boxersoftware.com/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Back in the old days the way I used to get special characters into files was to create a file that contained only the desired character, then use the "type" command from DOS and redirect the character into the file I was building. The secret is to remove the carriage return and line feed from the file that contains the special character. The way I accomplished that was to use an editor that could write the special character (used to be PCWrite but I no longer own a copy of that) then I used a little freeware tool called change.com that would let you change the text in a file from one thing to another at the DOS command line. For example at a DOS promt you would type:
change filename 13,10 ""
That would take all instances of carriage return line feed and change them to nul. This would provide a 1 byte file with only the special character in it.
15 minute typing break.........
I just used DOS edit to write a file with ascii character 001 in it. Then I used change.com to remove the carriage return and line feed. I now have a one byte file I called ascii_001.
Using this technique in macro scheduler would be something like:
Let>RP_WAIT=1
Run>cmd /c type ascii_001 >> remedy_macro
//then, since there's no carriage return and line feed I can do a
//writeln> and the result will end up on the same line directly following
//ascii 001
WriteLn>remedy_macro,wresult,whatever the heck I want to write.
I would end up with a line in remedy_macro:
☺whatever the heck I want to write.
If you have any interest in this, PM your email to me and I'll send you a copy of change.com. Or a copy of any one byte file you want me to create. As long as the one byte is an aascii char I can make with DOS edit.
By the way to put any ascii character into DOS edit, follow this process.
- Open a DOS window
- type Edit at the command line and press enter
- press ctrl + p
- press and hold alt while you type the 3 digit ascii code of the character you want using the number pad.( You have to use the number pad)
- release alt.
You should now see your ascii character in the editor.
Hope this is helpful,
Dick
change filename 13,10 ""
That would take all instances of carriage return line feed and change them to nul. This would provide a 1 byte file with only the special character in it.
15 minute typing break.........
I just used DOS edit to write a file with ascii character 001 in it. Then I used change.com to remove the carriage return and line feed. I now have a one byte file I called ascii_001.
Using this technique in macro scheduler would be something like:
Let>RP_WAIT=1
Run>cmd /c type ascii_001 >> remedy_macro
//then, since there's no carriage return and line feed I can do a
//writeln> and the result will end up on the same line directly following
//ascii 001
WriteLn>remedy_macro,wresult,whatever the heck I want to write.
I would end up with a line in remedy_macro:
☺whatever the heck I want to write.
If you have any interest in this, PM your email to me and I'll send you a copy of change.com. Or a copy of any one byte file you want me to create. As long as the one byte is an aascii char I can make with DOS edit.
By the way to put any ascii character into DOS edit, follow this process.
- Open a DOS window
- type Edit at the command line and press enter
- press ctrl + p
- press and hold alt while you type the 3 digit ascii code of the character you want using the number pad.( You have to use the number pad)
- release alt.
You should now see your ascii character in the editor.
Hope this is helpful,
Dick
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am
Wow, thanks for the replies guys, JRL the idea you have, while very simple, and I'm sure effective, would mean that I would need this application installed on all users machines, plus there is the "idiot" factor where the ascii001 file is bound to be deleted etc. There are ways around all this but ideally, I would simply do something like :
writeln>test.txt,result,A load of text ascii>001 a load more text etc
N.B I have tried
let>p=ascii>1
writeln>test.txt,result,A load of text %p% a load more text etc
Neither works.
Thanks again.
writeln>test.txt,result,A load of text ascii>001 a load more text etc
N.B I have tried
let>p=ascii>1
writeln>test.txt,result,A load of text %p% a load more text etc
Neither works.
That would be a good workaround, but I am finding the application of the idea all but impossible... But I'll try, then post my results, see if you guys think I am on the right track.Maybe it would be simpler to write the file with a unique character, like "~", substituted for the ascii 001 and then do a replace in the final file (vbscript).
Thanks again.
don't be a chicken little
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am
Tried a stringreplace type of thing :
it doesn't work.... It looks like I need to get MS to run ascii>1 first. Kind of a BODMAS thing in maths do the brackets first....
Stringreplace>remmacro,[ascii>1],€,newscript
I have no idea hopefully you will get where I am pointing.
Code: Select all
readln>c:\test.arq,5,remmacro
Stringreplace>remmacro,ascii>1,€,newscript
writeln>c:\newtest.arq,newscript
Stringreplace>remmacro,[ascii>1],€,newscript
I have no idea hopefully you will get where I am pointing.
don't be a chicken little
Miles,
What a brilliant idea. I use a similar system by the sounds of it. It sounds to me like you are trying to create Remedy macros on the fly, probably inputting several variables.
Having read some of the ideas above I gave this a try and it seems to create a file that will populate a New remedy form fairly well. Using JRL's above idea this is what I tried:
See if it works for you
What a brilliant idea. I use a similar system by the sounds of it. It sounds to me like you are trying to create Remedy macros on the fly, probably inputting several variables.
Having read some of the ideas above I gave this a try and it seems to create a file that will populate a New remedy form fairly well. Using JRL's above idea this is what I tried:
Code: Select all
Readln>C:\soh.txt,1,soh
Let>head=soh
Writeln>C:\AUTOMACRO.arq,result,AUTOMACRO%LF%Set-schema: TkT-TT-Main%head%stkp1.stk.orange.co.uk%LF%Form-open: %LF%Submit-display: TkT-TT-Main%LF%Form-final: new%head%800002160=%head%800002151=No%head%800002086=Yes%head%800002018=%head%800002005=Only AssignedGrp Can Update%head%800001931=1209600%head%800001869=Yes%head%800001861
etc.
where code i.e.800001869 is the ID for a particular box on the form.
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am
me_again
Spot on !!!
I made a slight adjustment as you can see to write to file, but you have solved my little problem.
Out of curiosity is chr(1)) the ascii>1 ie. chr(23)) would be ascii>23 ?
Thanks for your replies, another happy customer.
Spot on !!!
Code: Select all
VBstart
VBend
Let>mystring=sdaf^safdsfsa^
VBEval>Replace("%mystring%","^",chr(1)),newstring
writeln>c:\test.txt,result,newstring
Out of curiosity is chr(1)) the ascii>1 ie. chr(23)) would be ascii>23 ?
Thanks for your replies, another happy customer.
don't be a chicken little
-
- Junior Coder
- Posts: 24
- Joined: Sun Jun 11, 2006 9:50 am