My App is to copy a text and numbers to other Applications selected by user such as: Microsoft Word, Text Edit, Excel and some similar apps. I use AppleScriptMBS to call selected app and then activate it and then Paste my text into.
Problem is: if I Write the app name my self it works very good. But if i call it by its name from preferences window were the user choose his favorite app it dose not work. Here is the example:
dim a as new AppleScriptMBS dim lines(-1) as string //lines.Append "tell application ""Microsoft Word""" <<<<<<<< This line of code works just fine, I don't want it lines.Append "tell application " + Str(Preferences.AppName.text) <<<<<<<< This line of code doesn't work!! i want to use this lines.Append " activate" lines.Append "Paste" lines.Append "end tell" a.Compile Join(lines, EndOfLine.Macintosh) a.Execute
The : (Preferences.AppName.text) is the saved name of user Application choice, For example: "Microsoft Word" in my application Preferences window.
I don't want to call App by it's name because Applications are different from user to user.
Any help Please.