Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- DYMO Label Software v8 SDK
- This example demonstrates how to create an address label from scratch by adding a new Address Object and setting its attributes.
- *)
- on SplitString(TheBigString, fieldSeparator)
- tell AppleScript
- set oldTID to text item delimiters
- set text item delimiters to fieldSeparator
- set theItems to text items of TheBigString
- set text item delimiters to oldTID
- end tell
- return theItems
- end SplitString
- on DefaultHandler(params)
- set {barcodevalue, sampleidvalue, patientnamevalue, patientdobvalue, sample_statevalue} to SplitString(params, ";")
- tell application "DYMO Label"
- openLabel in "NCGL-Sample-Tube.label"
- set brc to a reference to first item of print objects
- tell brc
- set barcodeText to barcodevalue
- end tell
- set sampleid to a reference to second item of print objects
- tell sampleid
- set content to sampleidvalue
- set disableShrinkToFit to false
- set firstLineFontSize to 8
- set firstLineFontName to "Helvetica"
- end tell
- set patientname to a reference to third item of print objects
- tell patientname
- set content to patientnamevalue
- set disableShrinkToFit to false
- set firstLineFontSize to 12
- set firstLineFontName to "Helvetica"
- end tell
- set patientdob to a reference to fourth item of print objects
- tell patientdob
- set content to patientdobvalue
- set disableShrinkToFit to false
- set firstLineFontSize to 11
- set firstLineFontName to "Helvetica"
- end tell
- set top_sampleid to a reference to fifth item of print objects
- tell top_sampleid
- set content to sampleidvalue
- set disableShrinkToFit to false
- set firstLineFontSize to 12
- set firstLineFontName to "Helvetica"
- end tell
- set sample_state to a reference to sixth item of print objects
- tell sample_state
- set content to sample_statevalue
- set disableShrinkToFit to false
- set firstLineFontSize to 7
- set firstLineFontName to "Helvetica"
- end tell
- set top_sample_state to a reference to seventh item of print objects
- tell top_sample_state
- set content to sample_statevalue
- set disableShrinkToFit to false
- set firstLineFontName to "Helvetica"
- end tell
- redrawLabel
- printLabel2
- end tell
- return true
- end DefaultHandler
- DefaultHandler("1234;s10001;Kassandra Chauvin;9/24/1973;gDNA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement