• 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
Re: Checking on the existence of a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking on the existence of a file


  • Subject: Re: Checking on the existence of a file
  • From: "koenig.yvan" <email@hidden>
  • Date: Wed, 24 Oct 2012 19:08:14 +0200


You may use :

on save_names(note_names)
set pathToDocuments to (path to documents folder) as text
set pathToFolder to pathToDocuments & "Evernote:Notes:" -- as text
set FileName to text returned of (display dialog "Set new file name:" default answer "Content.txt")


set filePath to (pathToFolder & FileName)
tell application "System Events"
if not (exists file filePath) then
make new file at end of folder pathToFolder with properties {name:FileName}
end if
end tell
set filePath to filePath as alias



tell application "TextWrangler"
set existFile to open filePath
set the contents of existFile to note_names
save existFile
end tell
end save_names

Yvan KOENIG (VALLAURIS, France) mercredi 24 octobre 2012 19:07:57





 _______________________________________________
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

References: 
 >Checking on the existence of a file (From: Eric Robertson <email@hidden>)

  • Prev by Date: Checking on the existence of a file
  • Next by Date: Re: Checking on the existence of a file
  • Previous by thread: Checking on the existence of a file
  • Next by thread: Re: Checking on the existence of a file
  • Index(es):
    • Date
    • Thread