My javascript script not working

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
dwayneosmith
Newbie
Posts: 3
Joined: Sat Jan 08, 2022 6:09 am

My javascript script not working

Post by dwayneosmith » Sat Jan 08, 2022 10:11 am

I want to include a javascript file in the project. Everything works fine but this script file does not work. I'm executing following code:

Code: Select all

ExecuteFile>E:\\script.js

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: My javascript script not working

Post by Dorian (MJT support) » Sat Jan 08, 2022 2:07 pm

Does this thread help?
Yes, we have a Custom Scripting Service. Message me or go here

dwayneosmith
Newbie
Posts: 3
Joined: Sat Jan 08, 2022 6:09 am

Re: My javascript script not working

Post by dwayneosmith » Sun Jan 09, 2022 6:12 am

Yes, I saw this earlier before starting this thread. Initially, I tried the run command but then I decided to use the executefile command.

dwayneosmith
Newbie
Posts: 3
Joined: Sat Jan 08, 2022 6:09 am

Re: My javascript script not working

Post by dwayneosmith » Sun Jan 09, 2022 7:25 am

Is there any way to code the javascript functions ? I have the javascript code to develop a binary translator like this: https://binarytotext.net. I'm going through this thread right now: viewtopic.php?t=6198

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: My javascript script not working

Post by JRL » Tue Jan 11, 2022 2:06 pm

I have no idea how to make your java script run within Macro Scheduler. I'm also unsure what all you are looking to accomplish but hex and octal and decimal and ansi conversion examples are all over the internet in vbscript. Vbscript, of course, runs natively in Macro Scheduler I've had this one for about twenty years, no idea where I got it or if I wrote it myself. I modified it a bit this morning to make it convert the octet string on the website you posted into a readable word. It should be able to convert any space delimited string of octets into their ansi character counterparts.

Code: Select all

Let>bList=01000011 01101111 01101110 01110110 01100101 01110010 01110100
Separate>blist,space,vBin
Let>kk=0
Let>vWord=
Repeat>kk
Add>kk,1
Let>Binary=vBin_%kk%
Let>DecNum=0
Let>BitCount=0
While>{%BitCount%<Length(%Binary%)}
   Let>BitCount=BitCount+1
   VBEval>%DecNum% + (Cint(Mid("%Binary%",Len("%Binary%")-%BitCount%+1,1)) * (2 ^ (%BitCount% - 1))),DecNum
EndWhile
  VBEval>chr(%DecNum%),vTemp
  Let>vWord=%vWord%%vTemp%
Until>kk=vBin_Count

MDL>vWord

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts