• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Still after help with Barcode font issue, Please!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Still after help with Barcode font issue, Please!


  • Subject: Re: Still after help with Barcode font issue, Please!
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 27 Feb 2016 19:26:38 +1100

G’day all

Steve replied offlist, and his suggestions work!

Thank you.

Regards

Santa

tell application "TextEdit"
activate
tell application "System Events" to tell process "TextEdit"
keystroke "n" using command down
end tell
end tell
set theText to "This is barcode 128. "
repeat with x from 1 to 10
set theText to (theText & " " & x as text)
set theModulusCharacter to (my setUpTextCount(theText))
set theBarCodeText to theText & (character id theModulusCharacter)
delay 0.1


set the clipboard to ((character id 209) & theBarCodeText & (character id 211) as text)


tell application "TextEdit"
activate
tell front document
tell application "System Events" to tell process "TextEdit"
keystroke "v" using command down
end tell
set the font of last paragraph of its text to "Code 128"
set the size of last paragraph of its text to 36 # 
end tell
set the clipboard to (return & return as text)
tell front document
tell application "System Events" to tell process "TextEdit"
keystroke "v" using command down
end tell
end tell
end tell
end repeat

on setUpTextCount(theText)
set eachCharacterCount to 104 # the value of the start character for Barcode 128 Set B
repeat with x from 1 to count of theText # We start counting from the first character of the actual text,and multiply it’s adjusted value by its position
set eachCharacter to item x of theText
set eachCharacterAscii to (id of eachCharacter)
if eachCharacterAscii < 127 then
set subtractAsciiOffset to 32
else
set subtractAsciiOffset to 105
end if
set eachCharacterCount to eachCharacterCount + ((eachCharacterAscii - subtractAsciiOffset) * x)
end repeat
set theModulusNumber to eachCharacterCount mod 103
set theAddOnAscii to 32


# This commented out line uses 105 as the Font example shows, and thanks to Steve Mills, it now WORKS!
if theModulusNumber > 94 then set theAddOnAscii to 105


return theModulusNumber + theAddOnAscii
end setUpTextCount
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Still after help with Barcode font issue, Please! (From: Brian Christmas <email@hidden>)
 >Re: Still after help with Barcode font issue, Please! (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Still after help with Barcode font issue, Please!
  • Next by Date: Cannot get Java script to work with Acrobat DC
  • Previous by thread: Re: Still after help with Barcode font issue, Please!
  • Next by thread: Cannot get Java script to work with Acrobat DC
  • Index(es):
    • Date
    • Thread