Looping Script - I'll pay for help - Should be easy

I need help from someone smarter than I in AppleScript. The below script continually loops with the result that the TextEdit document gets printed repeatedly without stop. Can anyone tell me why and what I need to change? This is a subset of a larger example script provided to PageSender users. I’ve only removed extra stuff that they said was optional and the larger version had the same problem.

I’m willing to pay for help if someone can offer what it takes to get my job done. Thanks.

tell application “PageSender Fax Center”
set thePreset to make new preset at end of every preset
tell thePreset
set application name to “TextEdit”
set theFaxInfo to make new fax info at end of every fax info
tell theFaxInfo
set regarding to “Sample Regarding”
set message to “Sample Message”
set has cover to false
end tell
set theFirstRecipient to make new fax recipient at end of every recipient
tell theFirstRecipient
set country code to “1”
set phone number to “949-709-7705”
set name to “Robert Ameeti”
set company to “Sample Company”
set fax service to efax
end tell
end tell
– Save the preset to a file
save thePreset
– Delete the preset from memory
delete thePreset
end tell
tell application “TextEdit”
set licensePath to “/Applications/PageSender Fax Center.app/Contents/Resources/License Agreement.txt”
print {POSIX file licensePath}
end tell

savePrinter() of me

on savePrinter()
set savePrinter to null
tell application “Printer Setup Utility”
set savePrinter to current printer
set psPrinter to null
set psPrinters to printers whose kind is “PageSender-Fax”
if (count psPrinters) > 0 then
set psPrinter to item 1 of psPrinters
end if
if psPrinter is not null then
set current printer to psPrinter
end if
end tell
end savePrinter


welcome to MacScripter.

Your code doesn’t contain any loop sequences, so it couldn’t actually be the cause.
There must be a function in PageSender which triggers the script continously

Hmmm. Well, I did change the application being called to print the document from TextEdit to TextWrangler and now it does not loop! Apparently there is some problem with TextEdit and its Print from AppleScript!

Onward to my other problem which I’ll post in a different thread.

Thanks for your oversight.