Say I want to print "hello world" NOT "hello world\n". How do I do this in Apple Script?
It appears log
cannot do this. Presumably write
could, except I can't figure out how to get standard output's file descriptor.
Say I want to print "hello world" NOT "hello world\n". How do I do this in Apple Script?
It appears log
cannot do this. Presumably write
could, except I can't figure out how to get standard output's file descriptor.
I think instruction 'keystroke' from "System Events' should do what you want. It simulate entries via keyboard. In order to simulate that entry in an other program, you must first make this other program in front (with activate)
the script bellow makes Word up front and then types the sentence, without \n in the document, where the cursor is.
tell application "Microsoft Word" to activate
tell application "System Events" to keystroke "this is my text without return"
You can also use 'keystroke' with options like 'using command down'. For instance, the following script simulate a 'command n' in Word which is the short cut for menu new document :
tell application "Microsoft Word" to activate
tell application "System Events" to keystroke "n" using command down