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

Notification

Icon
Error

Options
Go to last post Go to first unread
F9y4ng  
#1 Posted : Saturday, June 29, 2019 6:43:30 PM(UTC)
F9y4ng

Rank: Member

Reputation:

Groups: Approved
Joined: 6/20/2019(UTC)
Posts: 10
China

Hi,All.
How to make the following code work properly?

Code:
sp.CreateTimer("test", 1000, -1, String.raw`clip.Clear();sp.DeleteTimer("test");`);
Rob  
#2 Posted : Sunday, June 30, 2019 3:44:47 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Timers don't run on the main UI thread, so they cannot interact with COM, which is how the clipboard is accessed.

I'll look into this and see if there's something I can do to better support COM interaction within a timer script.
Rob  
#3 Posted : Sunday, June 30, 2019 12:36:29 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I've changed timers to invoke their scripts on the main thread.
It was pretty easy since I added the WM_COPYDATA functionality in 0.3.1.3; I just post the script to the main thread and let it execute there.
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.