StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Alexander_Yellow  
#1 Posted : Monday, May 22, 2023 6:43:43 AM(UTC)
Alexander_Yellow

Rank: Newbie

Reputation:

Groups: Approved
Joined: 5/22/2023(UTC)
Posts: 3
China
Location: Taiwan

the window.selection method of JS only apply for the browsers
I am quite confused about the difference between clearscript and the common JS,and if other language can also be uesd in this environment.
The claude ai give me the sp.editor and sp.Win32.SendMessage(handle, 0xD, 0, 0) both of them seem not existed.
So the main question is what am suppoesed I do to add prefix&suffix to the selection text ???





Rob  
#2 Posted : Tuesday, May 30, 2023 12:33:28 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,359
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
Can you give me a little more details regarding what you're trying to accomplish? Like a step-by-step breakdown.
Alexander_Yellow  
#3 Posted : Tuesday, May 30, 2023 12:35:08 AM(UTC)
Alexander_Yellow

Rank: Newbie

Reputation:

Groups: Approved
Joined: 5/22/2023(UTC)
Posts: 3
China
Location: Taiwan

//clip.Clear
//sp.Sleep(20)
//sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_C]);
//sp.Sleep(20)
//var s=clip.GetText()
//var prefix='{{c::'
//var suffix='}}'
//var result=prefix+s+suffix
//sp.SendString(result)
Rob  
#4 Posted : Tuesday, May 30, 2023 4:09:09 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,359
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
This seems to work fine for me, what issue are you having?

Code:
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_C]);
sp.Sleep(20)
var s=clip.GetText()
var prefix='{{c::'
var suffix='}}'
var result=prefix+s+suffix
sp.SendString(result)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.