2

The scenario is , I'm going to pass some text to the LabelWriter Printer .. Its a sample for checking. But at compile time itself getting error.

 tell application "AppleScript Runner"

OPEN “COM1:9600,n,8,1” FOR OUTPUT AS #1 
PRINT #1, “HELLO WORLD”

end tell

Error: Expected end of line, etc. but found unknown token

Kumar KL
  • 15,315
  • 9
  • 38
  • 60
  • `OPEN “COM1:9600,n,8,1” FOR OUTPUT AS #1` looks like BASIC or VBA. Are you sure that is valid AppleScript syntax? – Martin R Mar 15 '13 at 13:39
  • 1
    To add to what @MartinR said, "COM1" is very much a DOS/Windows-ism. OSX is Unix-based, and as such, serial ports will typically be specified as some device file in the /dev directory. I am assuming that your physical serial port is provided by some external peripheral, so the name of the device file in /dev will be very much dependent on that. – Digital Trauma Mar 15 '13 at 15:04
  • Google has some interesting results - search for "applescript serial port". In particular, it looks like you may need to install something like the SerialPort X scripting addition: http://www.macupdate.com/app/mac/20440/serialport-x. I have never seen this freeware before so can in no way endorse its functionality/reliability/safety. – Digital Trauma Mar 15 '13 at 15:17
  • anybody have idea that I can send a text to print . I have SDK and plugin for browser. I don't know how to use the sdk . – Kumar KL Mar 18 '13 at 04:50

1 Answers1

1

To add to the comments by Atomic Toothbrush.

This is a snippet from one of my old Applescripts that uses the built in Command line [efax (fax)1 program to communicate with a modem.

set phone_num to "0207000000"
set thecall to do shell script "efax -v0 -d /dev/cu.modem -a TDT" & phone_num

I have also used the built in Command line program Screen to receive data from a totem Bluetooth Modem. ( I do not have a snippet to hand at the mo. On an old mac which I will need to dig out)

But before you even get into trying this you should read up on Applescript basics.

markhunte
  • 6,805
  • 2
  • 25
  • 44