[solved] Copying and pasting text displayed in OpenSesame into a different program
Hello,
I am relatively new to OpenSesame and just struck a problem - would appreciate any help I can get! I am trying to run an experiment with a variety of tasks - including one about virtual worlds, which would have to be interlaced with all the rest.
A set of online virtual environments (VEs) would be selected for the experiment, and participants would be shown one of them randomly, and they would then have a predetermined length of time to explore it. Since these VEs would be outside OpenSesame, I would like participants to simply be shown the URL for each, which they could then copy and paste into another program to access them. This would save some time and reduce the margin for error when participants would search for the environments.
The problem, however, is I can't seem to get OpenSesame to allow copying and pasting, either from a sketchpad item, or a form, as they are being displayed during the experiment... Ideally, during the experiment I would have liked a sketchpad (or anything, really) to appear with the VE's URL written on it, which participants could then simply copy and paste into a different program...
Any advice would be much appreciated!
Many thanks!
AC
Comments
Hi,
You cannot easily copy stuff from an OpenSesame experiment to the clipboard, because what you see during an experiment is essentially a slideshow of pictures, which the operating system doesn't know how to copy/paste from.
In your case, would it be sufficient to have OpenSesame launch a browser automatically with a specific URL? That might even be more convenient for the user, and is much easier to implement. You can see an example of that in this discussion:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks loads!
Based on that example, I was able to find this solution for instance:
...This is because in my case the program to be launched is not a regular internet browser, but a SecondLife viewer... Even if the current solution works, the problem now becomes that it does so only by opening more instances of the viewer, instead of changing the URL in the same viewer. Since my experiment would contain quite a few virtual environments, this would become a problem very fast... Could you please help with finding a way to just change the URL without opening more instances of the subprocess?
I considered something like this:
...which of course doesn't work, as I don't really know what I am doing... :-D
Again, any help would be deeply appreciated!
Thanks for the previous suggestion and all your work with OpenSesame in general!
AC
This depends on the behavior of the program. Most webbrowsers will check to see if another instance is already running, and, if so, open the url in a new tab within an existing instance. But apparently the software that you use doesn't do that.
In that case, you may want to use the clipboard like you initially had in mind. But you'll need to install some module so that you can copy stuff to the clipboard, such as
pyperclip
. You should be able to download the source file (see link below), and extract thepyperclip
folder within it (so the folder with only an__init__.py
file in it) to the OpenSesame program folder. Once you've done that, you should be able to access the clipboard as shown in the examples on thepyperclip
page.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi,
Thanks again for your help! I really appreciate it.
Coincidentally, it seems that an upgraded version of CtrlAltStudio does check if an instance is already running, or at least that's what I infer from what happened: I upgraded a couple of days ago and now the URLs get changed in the same instance of the viewer...
Hopefully my assumption is correct and now it will keep working with the code I provided above!
I will keep pyperclip in mind though, might come in handy in the future!
Thanks again!
Caterina
Love it when a problem solves itself! Marking this as solved.