一个想法(an idea)
All  1-3  4-5

Previous
Next
 From:  大道刀 (SUIYAN)
12027.4 In reply to 12027.3 
HI Michael
抱歉,我完全不懂代码,所以我不知道这两段代码如何使用,昨天我一直尝试使用AI(豆包的免费版本)编写这两段代码的功能脚本,结果是无效的脚本。所以,我该如何使用这两段代码?是编写独立的脚本或者添加到某个文件中,让代码发挥作用。(Sorry, I don't understand code at all, so I don't know how to use these two pieces of code. Yesterday, I kept trying to use AI (the free version of Doubao) to write functional scripts for these two pieces of code, but the scripts were invalid. So, how should I use these two pieces of code? Should I write separate scripts or add them to a certain file to make the code work.)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
12027.5 In reply to 12027.4 
Hi SUIYAN,

re:
> Yesterday, I kept trying to use AI (the free version of Doubao) to write functional scripts
> for these two pieces of code, but the scripts were invalid.

Yes I've heard from others that tried to make MOI scripts using AI and it tends to generate just non-functional garbage code. I suspect there is not enough training data available for it to work very well.

For the first one showing how to set the title property you could put that code into a .js file, then (using MOI v4 or higher) put that .js file into the Moi appdata startup folder. When MOI is launched any .js files in that folder are loaded and run.

Another way to run it which should work in V3 is to add script: to the start of it and do a Ctrl+C to copy it to the clipboard. Then inside MoI type the Tab key to put keyboard focus into the XYZ input control, then Ctrl+V and Enter will run that code, setting the title="" attribute on every <moi:CommandButton> in the currently loaded UI.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-3  4-5