Paste on a Mac
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Paste on a Mac
On a PC I can copy a chunk of text from a .pdf file and paste it into a field using 'put the clipboarddata into field "XXX"'. On a Mac when that is done nothing appears in the field. If, however, I copy the text and paste it into TextEdit, then select all that text and copy it again, then say 'put the clipboarddata into field "XXX"' and it is there. Is there a good explanation for why this happens? Also is there a cleaner workaround than what I have to do?
Thanks,
Larry
Thanks,
Larry
Re: Paste on a Mac
Hi Larry,
just tested here and works without problems!?
Try:
...
put the clipboarddata["text"] into fld x
...
Since "clipboarddata" is an array actually
Best
Klaus
just tested here and works without problems!?
Try:
...
put the clipboarddata["text"] into fld x
...
Since "clipboarddata" is an array actually

Best
Klaus
Re: Paste on a Mac
Hi Klaus,
It still does not work for me. I even tried 'put the clipboarddata["text"] into tData' prior to putting it in the field and there was nothing in tData. It has been this way ever since I can remember and I just finally got tired of trying to work around it.
Larry
It still does not work for me. I even tried 'put the clipboarddata["text"] into tData' prior to putting it in the field and there was nothing in tData. It has been this way ever since I can remember and I just finally got tired of trying to work around it.
Larry
Re: Paste on a Mac
Hi Larry,
hmm, I'm puzzled, since I tried this here with a couple of PDF files and it works.
What version are you using? I am using 5.5.2.
If I remember correctly there WAS indeed a bug in earlier versions with pasting text from PDFs!
Best
Klaus
hmm, I'm puzzled, since I tried this here with a couple of PDF files and it works.
What version are you using? I am using 5.5.2.
If I remember correctly there WAS indeed a bug in earlier versions with pasting text from PDFs!
Best
Klaus
Re: Paste on a Mac
I am also in 5.5.2. The .pdf has been opened in Adobe Reader and the material is about 4 pages worth of text from Investors Business Daily.
Regards,
Larry
Regards,
Larry
Re: Paste on a Mac
Klaus,
I have attached the script for 'myPaste' which is called from the Edit Menu. It shows how I have had to work around what happens on the Mac but not on the PC.
Thanks for looking,
Larry
I have attached the script for 'myPaste' which is called from the Edit Menu. It shows how I have had to work around what happens on the Mac but not on the PC.
Code: Select all
on myPaste
if the visible of field "RawPages" is true then
put the number of lines of field "RawPages" into tRaw
if the clipboard is text then
--put the clipboarddata["text"] into tData
put the clipboardData["text"] after field "RawPages"
send "FormatRawPages" to field "RawPages"
put the number of lines of field "RawPages" into tNewRaw
If tNewRaw = tRaw then
answer warning "Paste failure 'work-around':" & numtochar(10) & numtoChar(10) & "1. Paste the data into a simple text editor." & \
numtochar(10) & "2. 'Select All' from text editor and copy again." & numtochar(10) & \
"3. Paste once more into this application." titled "Paste Failure"
end if
end if
else
answer warning "Paste is not done here. Use 'Toggle Views'."
end if
end myPaste
Larry
Re: Paste on a Mac
Hi Larry,
hmm, so obvioulsy PDF <> PDF, looks like this might have to do with the text enconding of your PDFs...
I would consider it a bug, so if you like write to bugs@runrev.com with a sample PDF.
Hint:
Save some typing and use a simple CR instead of numtochar(10)
...
answer "Line 1" & CR & "Line 2" & CR & "Line 3"
...
BTW: CR is the official "Linedelimiter" in Livecode.
Best
Klaus
hmm, so obvioulsy PDF <> PDF, looks like this might have to do with the text enconding of your PDFs...
I would consider it a bug, so if you like write to bugs@runrev.com with a sample PDF.
Hint:
Save some typing and use a simple CR instead of numtochar(10)

...
answer "Line 1" & CR & "Line 2" & CR & "Line 3"
...

BTW: CR is the official "Linedelimiter" in Livecode.
Best
Klaus