Seeing if a file exsists and exporting Xcode project

I have a series of two questions:

  1. I need to know how to see if a file exsists in a certain folder. For example:

if /library/preferences doesn't contain file "Example.html"
set P to path to preferences folder from local domain
set ET to open for access (P as text) & "Example.txt"
close access ET
end if

Where if the file wasn’t there, it would make it.

  1. How do I export an AppleScript XCode project .app so people can download it from my site and use it without the .xcodeproj file?

Thanks

You can check for the presence of a file in this manner:

set a to "Pilate:Users:cas:Library:LaunchAgents:WatchVolumes02.plist"
try
	alias a
on error
	display dialog (a & " is not found...")
end try

Which works well when you know the full path. If you know where is should be, just build the path:

set a to ((path to home folder as Unicode text) & "Library:LaunchAgents:WatchVolumes02.plist")
try
	alias a
on error
	display dialog (a & " is not found...")
end try

Either way, you now have the full path in a variable that you can use to write the file you want there, if it is not already present.

As for the Xcode application, once it is ready, perform Clean All Targets, then switch the Build Mode to Release. You will find your freshly built application in the Build>Release folder of your Xcode project. You can move it where ever you want for download.

Good luck,