OSX Coding Help
OSX Coding Help
- Subject: OSX Coding Help
- From: Jeff Grossman <email@hidden>
- Date: Fri, 27 Jun 2003 07:55:17 -0700
I have the following script which will delete some files, if they exist, and
then export some address lists from LetterRip Pro. I want the script to run
from cron as an application. If I remove the beginning part which deletes
the existing files the script will run fine via cron. If I add back in the
part about deleting files, the script will not run via cron. Is it not
possible to do what I want with Applescript and cron?
Thanks,
Jeff
Script Follows:
tell application "Finder"
if exists file "OSX:List Addresses:Fishads Addresses" then
delete file "OSX:List Addresses:FishAds Addresses"
end if
end tell
tell application "Finder"
if exists file "OSX:List Addresses:Huntads Addresses" then
delete file "OSX:List Addresses:HuntAds Addresses"
end if
end tell
tell application "Finder"
if exists file "OSX:List Addresses:FishReports Addresses" then
delete file "OSX:List Addresses:FishReports Addresses"
end if
end tell
tell application "Finder"
if exists file "OSX:List Addresses:HuntReports Addresses" then
delete file "OSX:List Addresses:HuntReports Addresses"
end if
end tell
tell application "Finder"
if exists file "OSX:List Addresses:News Addresses" then
delete file "OSX:List Addresses:News Addresses"
end if
end tell
tell application "Finder"
empty trash
end tell
set the FishadsAddressFile to open for access "OSX:List Addresses:Fishads
Addresses" with write permission
tell application "LetterRip_Server"
set a_list to subscriber list "Fishads"
set theCount to count of subscribers of a_list
set cur to 1
repeat until cur > theCount
set theSub to subscriber cur of a_list
set theName to name of theSub
set theAddress to email address of theSub
set cur to cur + 1
my WriteFile(FishadsAddressFile, theName, theAddress)
end repeat
end tell
close access FishadsAddressFile
set the HuntadsAddressFile to open for access "OSX:List Addresses:Huntads
Addresses" with write permission
tell application "LetterRip_Server"
set a_list to subscriber list "Huntads"
set theCount to count of subscribers of a_list
set cur to 1
repeat until cur > theCount
set theSub to subscriber cur of a_list
set theName to name of theSub
set theAddress to email address of theSub
set cur to cur + 1
my WriteFile(HuntadsAddressFile, theName, theAddress)
end repeat
end tell
close access HuntadsAddressFile
set the FishReportsAddressFile to open for access "OSX:List
Addresses:FishReports Addresses" with write permission
tell application "LetterRip_Server"
set a_list to subscriber list "Fish Reports"
set theCount to count of subscribers of a_list
set cur to 1
repeat until cur > theCount
set theSub to subscriber cur of a_list
set theName to name of theSub
set theAddress to email address of theSub
set cur to cur + 1
my WriteFile(FishReportsAddressFile, theName, theAddress)
end repeat
end tell
close access FishReportsAddressFile
set the HuntReportsAddressFile to open for access "OSX:List
Addresses:HuntReports Addresses" with write permission
tell application "LetterRip_Server"
set a_list to subscriber list "Hunt Reports"
set theCount to count of subscribers of a_list
set cur to 1
repeat until cur > theCount
set theSub to subscriber cur of a_list
set theName to name of theSub
set theAddress to email address of theSub
set cur to cur + 1
my WriteFile(HuntReportsAddressFile, theName, theAddress)
end repeat
end tell
close access HuntReportsAddressFile
set the NewsAddressFile to open for access "OSX:List Addresses:News
Addresses" with write permission
tell application "LetterRip_Server"
set a_list to subscriber list "News"
set theCount to count of subscribers of a_list
set cur to 1
repeat until cur > theCount
set theSub to subscriber cur of a_list
set theName to name of theSub
set theAddress to email address of theSub
set cur to cur + 1
my WriteFile(NewsAddressFile, theName, theAddress)
end repeat
end tell
close access NewsAddressFile
to WriteFile(myFile, aName, anAddress)
write aName & tab & anAddress & return to myFile
end WriteFile
--
Jeff Grossman (email@hidden)
Director - Information Systems, Turner's Outdoorsman
http://www.turners.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.