Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. (*
  2.  
  3. DYMO Label Software v8 SDK
  4.  
  5. This example demonstrates how to create an address label from scratch by adding a new Address Object and setting its attributes.
  6.  
  7. *)
  8.  
  9. on SplitString(TheBigString, fieldSeparator)
  10. tell AppleScript
  11. set oldTID to text item delimiters
  12. set text item delimiters to fieldSeparator
  13. set theItems to text items of TheBigString
  14. set text item delimiters to oldTID
  15. end tell
  16. return theItems
  17. end SplitString
  18.  
  19. on DefaultHandler(params)
  20.  
  21. set {barcodevalue, sampleidvalue, patientnamevalue, patientdobvalue, sample_statevalue} to SplitString(params, ";")
  22.  
  23. tell application "DYMO Label"
  24. openLabel in "NCGL-Sample-Tube.label"
  25. set brc to a reference to first item of print objects
  26.  
  27. tell brc
  28. set barcodeText to barcodevalue
  29. end tell
  30.  
  31. set sampleid to a reference to second item of print objects
  32.  
  33. tell sampleid
  34. set content to sampleidvalue
  35. set disableShrinkToFit to false
  36. set firstLineFontSize to 8
  37. set firstLineFontName to "Helvetica"
  38. end tell
  39.  
  40. set patientname to a reference to third item of print objects
  41.  
  42. tell patientname
  43. set content to patientnamevalue
  44. set disableShrinkToFit to false
  45. set firstLineFontSize to 12
  46. set firstLineFontName to "Helvetica"
  47. end tell
  48.  
  49. set patientdob to a reference to fourth item of print objects
  50.  
  51. tell patientdob
  52. set content to patientdobvalue
  53. set disableShrinkToFit to false
  54. set firstLineFontSize to 11
  55. set firstLineFontName to "Helvetica"
  56. end tell
  57.  
  58.  
  59. set top_sampleid to a reference to fifth item of print objects
  60.  
  61. tell top_sampleid
  62. set content to sampleidvalue
  63. set disableShrinkToFit to false
  64. set firstLineFontSize to 12
  65. set firstLineFontName to "Helvetica"
  66. end tell
  67.  
  68. set sample_state to a reference to sixth item of print objects
  69.  
  70. tell sample_state
  71. set content to sample_statevalue
  72. set disableShrinkToFit to false
  73. set firstLineFontSize to 7
  74. set firstLineFontName to "Helvetica"
  75. end tell
  76.  
  77. set top_sample_state to a reference to seventh item of print objects
  78.  
  79. tell top_sample_state
  80. set content to sample_statevalue
  81. set disableShrinkToFit to false
  82. set firstLineFontName to "Helvetica"
  83. end tell
  84.  
  85. redrawLabel
  86. printLabel2
  87.  
  88. end tell
  89. return true
  90. end DefaultHandler
  91.  
  92. DefaultHandler("1234;s10001;Kassandra Chauvin;9/24/1973;gDNA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement