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 12:43:30 PM(UTC)
F9y4ng

Rank: Newbie

Reputation:

Groups: Approved
Joined: 6/20/2019(UTC)
Posts: 8
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 : Saturday, June 29, 2019 9:44:47 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 208
United States

Thanks: 4 times
Was thanked: 39 time(s) in 32 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 6:36:29 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 208
United States

Thanks: 4 times
Was thanked: 39 time(s) in 32 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.