AppleScript Help - reading a file and sending the text

Discussion in 'Mac Programming' started by crobbulan, Mar 11, 2010.

  1. crobbulan macrumors newbie

    Joined:
    Mar 11, 2010
    #1
    Hi there,

    I have been using simple AppleScripts to send code to a CAD application through QuickKeys. Unfortunately, my new setup has broken this system.

    Basically, the script sends a few lines of code to the application using a built-in "DoScript" call. For example:

    Code:
    tell application "VectorWorks 12.5.3"
    DoScript
    "Procedure PrefToggle;
    Begin
    SetPref(10,NOT(GetPref(10)));
    End;
    
    Run(PrefToggle);"
    end tell
    
    This worked great under Tiger but fails in Snow Leopard. It's my understanding that the problem is that 10.6 now sends text from scripts in Unicode, which the older version of VectorWorks (12.5.3) does not interpret. What I think I need to do is send the text from a plain text file. That file could be stored on my computer in any location (preferably Macintosh HD/Library/Application Support/)

    I'm new to scripting and am having trouble doing this. Any help would be great.

    The Crobbulan
     
  2. paintstripper macrumors newbie

    Joined:
    Mar 13, 2010
    #2
    This link may help - Link

    It has some information about reading files as ascii specifically the Macintosh Encoding which may help in what you are trying to do.
     

Share This Page