hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.23k stars 429 forks source link

Select(0) not working on onStart script command #2727

Open aortega89 opened 1 month ago

aortega89 commented 1 month ago

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
  1. Close and open CopyQ.
  2. Clipboard is 'EMPTY'

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

Screenshots imagen

imagen

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

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