again: copy command doesn't work -- why?

I want to paste a number of files of a folder to a FileMaker database. Some proposed solutions give me the number in a dialog box. But I need the number in the clipboard!

I tried:
set x to count files of folder “Macintosh HD:OpusX:PixCD”
copy x

Finder got an error: 11 doesn’t understand the copy message.

11 is the correct number of files. But I can’t copy it! WHY?

I can’t use the duplicate command, this makes a copy of the file in the finder. This is not what I want.

“x” is a variable in memory, so you can’t “copy” it (anyway, the “copy” command doesn’t work at all). What you need is:

set the clipboard to x

Thx jj! Looks like a good idea – but it doesn’t work out.

Are you sure ‘clipboard’ is the right expression?
I also tried ‘set clipboard to x’ (without ‘the’) – my scripteditor (v1.9) understands that better, but either way the clipboard is empty after the command. On the other hand there is no error message. What happens?

I found the solution!

First, YOU were right, it has to be
set THE clipboard to x
(set clipboard to x doesn’t work)

What was missing is the addition ‘as text’
The right command line now is:
set the clipboard to x as text

Now FileMaker understands the entry and pastes it.

Thx for the clu to the solution!