• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
TextEdit Save Problem (Thomas Maffucci)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TextEdit Save Problem (Thomas Maffucci)


  • Subject: TextEdit Save Problem (Thomas Maffucci)
  • From: Thomas Maffucci <email@hidden>
  • Date: Thu, 24 Jan 2013 12:49:54 -0500
  • Thread-topic: TextEdit Save Problem (Thomas Maffucci)

Thanks for all your help I made one small addition to Yvan's solution to
delete the files since I will be running these scripts weekly. Everything
works fine as written when the files are on the desktop. But my knowledge of
Paths is very weak. I need help to modify the below script to function with
files in a folder named "Work" which sits on the desktop.

Script to be modified:

set ptd to path to desktop
--set ptd to ptd & "Work:"
set getpage to "This is a test 3"

set filelst to {"FedMangrealtxt", "AmCentPosBal", "AmCentrealtxt"}

repeat with File_item in filelst
    set newName to File_item & ".rtf"

    tell application "Finder"
        if exists file newName then
            delete file newName
            empty trash
        end if
    end tell

    tell application "System Events"
        make new file at end of ptd with properties {name:newName}
    end tell

    set newFile to ((ptd as text) & newName) as alias
    tell application "TextEdit"
        activate
        set Tithdr to File_item
        make new document with properties {name:newName}
        set text of document 1 to getpage
        save document 1 in newFile
        close document 1 without saving
        delay 1
        --open newFile
    end tell
end repeat


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: TextEdit Save Problem (Thomas Maffucci)
      • From: "koenig.yvan" <email@hidden>
  • Prev by Date: Re: TextEdit Save Problem (Thomas Maffucci)
  • Next by Date: [OT] Automator Crashing on simple script
  • Previous by thread: Fwd: TextEdit Save Problem (Thomas Maffucci)
  • Next by thread: Re: TextEdit Save Problem (Thomas Maffucci)
  • Index(es):
    • Date
    • Thread