copyclipboard > create file > paste text into it...

Hello,

I’m working on a local Flash Application and i need to create a text file and paste text into it.
I think i can do that with launching an Applescript with FSCommand in Flash but i’ need hel to write the applescript file:)
1 . copy text in copyclipboard in flash
2 . launch applescript with fscommand
3 . create a file on desktop and paste text into it

Thanks
JP
http://jeanphiblog.media-box.net/

  1. and append text in text file

Does text copied to the copyclipboard in Flash appear in the system’s clipboard? You can always see what’s there by selecting Show Clipboard in the Edit menu in the Finder’s menu bar. IF it does, then to create a file with that text in it:


--- knowing nothing about Flash....

set tFile to open for access (path to desktop as text) & "myTextFile.txt" with write permission
try
	set eof of tFile to 0 -- to overwrite what's there, or leave this line out to append the clipboard to whatever is already in it.
	write (the clipboard) to tFile
	close access tFile
on error
	close access tFile
end try

EXCELLENT ADAM !
It’s exactly what i want
because in Flash i paste texte in copyclipboard and after i launch a fscommand who run the applescript
Thanks a lot ! :slight_smile:
JP