Re: Applescript Newbie - OS9 to OSX
Re: Applescript Newbie - OS9 to OSX
- Subject: Re: Applescript Newbie - OS9 to OSX
- From: Emery Wilson <email@hidden>
- Date: Tue, 06 Dec 2005 11:29:28 -0800
Thanks for the response, I'll try to clarify these issues.
I am using Tex-Edit Plus to run the script in OS 9. I was not aware this
existed in OS X, was trying to get the script to run using TextEdit, so I
will try to find the OS X version of Tex-Edit Plus.
The script does open in OS X Script Editor, but it will not run.
Specifically what I do is I drag an email file from Outlook Express into a
file on the desktop and from there onto the script application icon.
Tex-edit then will open and convert the email to a text file and save it
into another folder on the desktop. This all happens in OS 9. What I am
attempting to do is make this same action happen in OS X. It does work on
the OS X machine when I run Classic, but I would prefer not to have to run
Classic just for this application. I have downloaded the new version of
Tex-Edit Plus as you suggest. I may need to receive the emails in OS X
version of mail so it may continue to default to the classic version.
Here is a copy of the first part of the script from it's original OS 9
file. This is not the complete file. When I move it to the OS X machine the
first problem occurs in line 14. When I drag the email file onto the script
icon the error message says "the variable Text01 is not defined". I've tried
making it a lower case t like the others, but when I compile the script it
changes it back to upper case. Is that an issue?
I don't know if I've clarified anything, but thanks again for the help.
on open fileList
tell application "Tex-Edit Plus"
activate
repeat with oneFile in fileList
open oneFile
set Testhtml to "PHSbcform"
set Test1 to "1"
set Test2 to "2"
search window 1 looking for Testhtml with cases matching
select character after selection
if selection = Test1 then
set TextA to "FONT_SIZE"
set TextB to "LOGO_SELECTED"
set Text01 to "SS_First_Name"
set text02 to "SS_Middle_Name"
set text03 to "SS_Last_Name"
set text04 to "Title1"
set text05 to "Title2"
set text06 to "Title3"
set text07 to "Phone1"
set text08 to "Phone1"
set text09 to "Ext1"
set text10 to "Phone2"
set text11 to "Phone2"
set text12 to "Ext2"
set text13 to "Phone3"
set text14 to "Phone3"
set text15 to "Ext3"
set text16 to "Phone4"
set text17 to "Phone4"
set text18 to "Ext4"
set text19 to "No_Email"
set text20 to "Email_Address"
set text21 to "Address1"
set text22 to "Address2"
set text23 to "Address3"
set text24 to "City"
set text25 to "State"
set text26 to "Zip_Code"
set text27 to "OTHER"
set Test to ""
end if
> From: Paul Berkowitz <email@hidden>
> Reply-To: email@hidden
> Date: Tue, 06 Dec 2005 10:23:56 -0800
> To: AppleScript-Users <email@hidden>
> Subject: Re: Applescript Newbie - OS9 to OSX
>
> On 12/6/05 10:03 AM, "Emery Wilson" <email@hidden> wrote:
>
>> I have been using an Applescript, written by someone else, which basically
>> takes email text and strips out the unwanted copy. These are for business
>> card orders, so a form is filled out then sent to me, and the script I run
>> opens the file in Text Edit and converts some of the text to spaces. I am
>> running OS 9 with this script
>
> Huh? TextEdit doesn't exist in OS 9. (And SimpleText is not scriptable.)
>
> If you mean Tex-Edit Plus (which is _much_ more scriptable), a version does
> exist in OS X, and is just as scriptable. You'd always need to check it
> over, but its AppleScript dictionary is almost the same, so the script might
> just work.
>
>> and would like to be able to use it in OS X.
>> However, simply copying the script and opening it in OSX script editor
>> doesn't work,
>
> What doesn't work? The script doesn't open at all in Script Editor? Or it
> opens but doesn't run?
>
>> it seems some of the commands are not the same? I really have
>> never done any scripting before, I have spent some time reading the help
>> menus etc. looking for a solution but can't come up with it. Any advice on
>> how to proceed, how to convert scripts from OS 9 to X, anything would help
>> at this point.
>
>
> Nobody can help if you're not a lot more specific. Describe what you're
> doing and where it goes wrong. We don't even know which app you're trying to
> script here. If it's Tex-Edit Plus, have you downloaded the current OS X
> version from its website? That would be a first step. Does the script then
> open in Script Editor? If you try to run it and it errors, what exactly
> errors? What's the error message? Which line is highlighted? Paste and copy
> the script, or at least from the beginning to the errored line.
>
> --
> Paul Berkowitz
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> ng.biz
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden