Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----- Export Text Operations -------------------------------------
- on exportText
- -- Requires handler: writeExportedText
- -- Requires function handler: lastHCItem
- -- if shiftKey is down use only the marked cards
- if the shiftKey is down then
- put false into useAllCards
- put "from marked cards" & space into prompt -- Æ
- put number of marked cards into numCards
- else
- put true into useAllCards
- put empty into prompt
- put number of cards in bg "Body" into numCards
- end if
- ask file "Export text" && prompt & "to the file:" with "Addresses Text File" -- Æ
- if the result is "Cancel" or it is empty then exit exportText
- put it into fileName
- writeExportedText numCards, useAllCards, fileName
- if numCards = 1 then put "card" into info -- Æ
- else put "cards" into info -- Æ
- answer "The text from" && numCards && info && Â
- "was exported to the new file Ò" & lastHCItem(":",fileName) & "Ó." -- Æ
- end exportText
- on writeExportedText numCards, useAllCards, fileName
- -- Requires function handler: theFields
- lock screen
- if useAllCards then go card 1 of bg "Body"
- else go first marked card
- put theFields() into fieldList
- open file fileName
- repeat with currentCard = 1 to numCards
- set cursor to busy
- put empty into theText
- repeat with i = 1 to (number of items in fieldList - 1)
- put value of (item i of fieldList) & tab after theText
- end repeat
- put SubstituteChar(return,"É", value of (item i + 1 of fieldList)) & Â
- tab & return after theText
- write theText to file fileName
- if not useAllCards then go next marked card
- else go next card of this bg
- end repeat
- close file fileName
- unlock screen
- end writeExportedText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement