File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ import {
12
12
mouse ,
13
13
sleep ,
14
14
straightTo ,
15
- clipboard ,
16
15
} from '@computer-use/nut-js' ;
17
16
import Big from 'big.js' ;
17
+ import { clipboard } from 'electron' ;
18
18
19
19
import { PredictionParsed } from '@ui-tars/shared/types' ;
20
20
@@ -179,14 +179,13 @@ export const execute = async (executeParams: ExecuteParams) => {
179
179
const stripContent = content . replace ( / \\ n $ / , '' ) . replace ( / \n $ / , '' ) ;
180
180
keyboard . config . autoDelayMs = 0 ;
181
181
if ( env . isWindows ) {
182
- const originalClipboard = await clipboard . getContent ( ) ;
183
- await clipboard . setContent ( stripContent ) ;
184
- logger . info ( '[clipboard] content' , await clipboard . getContent ( ) ) ;
182
+ const originalClipboard = clipboard . readText ( ) ;
183
+ clipboard . writeText ( stripContent ) ;
185
184
await keyboard . pressKey ( Key . LeftControl , Key . V ) ;
186
185
await sleep ( 50 ) ;
187
186
await keyboard . releaseKey ( Key . LeftControl , Key . V ) ;
188
187
await sleep ( 50 ) ;
189
- await clipboard . setContent ( originalClipboard ) ;
188
+ clipboard . writeText ( originalClipboard ) ;
190
189
} else {
191
190
await keyboard . type ( stripContent ) ;
192
191
}
You can’t perform that action at this time.
0 commit comments