hluk / hluk/CopyQ

Select(0) not working on onStart script command

Open
#2,727 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
12.3k
Forks
593
Avg merge
2d 8h
Merged PRs (30d)
9

Description

**Describe the bug**
When CopyQ starts the clipboard appears as 'EMPTY' so I tried to create a script command that runs at start and select the first entry to clipboard but nothing happen. The script is as follow:

```
var onStartPrevious = global.onStart
global.onStart = function() {
onStartPrevious()
select(0)
}
```
**To Reproduce**
1. Paste this command in commands window:

```
[Command]
Command="
var onStartPrevious = global.onStart
global.onStart = function() {
onStartPrevious()
select(0)
}"
Icon=1
IsScript=true
Name=Select first entry on Start
```
2. Close and open CopyQ.
3. Clipboard is 'EMPTY'

**Expected behavior**
First entry should get selected and show in 'Clipboard'.

**Screenshots**
![imagen](https://github.com/hluk/CopyQ/assets/84877330/95fa7fe5-b549-493e-b429-f07faae4f8e5)

![imagen](https://github.com/hluk/CopyQ/assets/84877330/2998a637-f167-44ea-945e-29b061db00c7)

**Version, OS and Environment**
CopyQ Clipboard Manager 8.0.0~mantic
Qt: 5.15.10
KNotifications: 5.110.0
Compiler: GCC
Arch: x86_64-little_endian-lp64
OS: Ubuntu 23.10

**Additional context**
Not sure if related to this [bug](https://github.com/hluk/CopyQ/issues/2693)

Tried changing 'select(0)' with 'popup('Hello, World!');' and it works fine.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.