I wanted a AppleScript that would copy all the text in the description area to the clipboard as plain text as opposed to the much slower manual selection and copy.
The problem is that the description refers to the html version of the text.
So you must transform the html back into plain text.
That html might contain special characters as typed or be represented as html entity number which might cause problems in the transformation.
The following code seems to work.
tell application "GarageSale 9.8.1"
repeat with theListing in (get selected ebay listings)
set des to get the description of theListing
end repeat
end tell
set theText to des
set plain_text to do shell script "echo " & quoted form of ("<!DOCTYPE HTML PUBLIC><meta charset=\"UTF-8\">" & theText) & space & "| textutil -convert txt -stdin -stdout"
set the_text to plain_text
set the clipboard to the_text
Perhaps this could be added to GS with a keyboard shortcut for situations where you want to quickly export the description as plain text.
Attempting to select all the text in GS’s description area using Command + A does not work most of the time, as it generally only selects the top portion of the area consisting of a random number of paragraphs regardless of where the cursor is located. Even if this did work the copied text would be rich text, which might not paste well into other applications, but plain text is more likely to be pasted without problems.
One use for this AppleScript I have is to quickly transfer descriptions and titles into Facebook Marketplace’s listing form. I essentially use GarageSale as a catalog for some large items more suitable for local pickup.