2 queries - file/creator type and do shell "rm"
2 queries - file/creator type and do shell "rm"
- Subject: 2 queries - file/creator type and do shell "rm"
- From: DizzyPenguin <email@hidden>
- Date: Thu, 26 Feb 2004 20:26:37 +0000
Hi,
On OSX 10.2 and above, 2 quick questions...
Is there any explanation why the following would throw an error when
setting the file/creator type on 2 systems out of hundreds? Even with
the error, the file gets created with the data in, but the file type is
"TEXT" and creator is "ttxt". (I haven't got the error message per say
because it doesn't occur on my system).
set the_data to "1234567890"
set test_file to (((path to preferences folder) as Unicode text) &
"Test File") as Unicode text
set the open_test_file to open for access file test_file with write
permission
set eof of the open_test_file to 0
write the_data to the open_test_file starting at eof
close access the open_test_file
tell application "Finder"
set the file type of (test_file as alias) to "pref"
set the creator type of (test_file as alias) to "ABFS"
end tell
Next question...
Can I assume that the following handler will work whether the user is
admin or guest?
on delete_file(the_file)
do shell script "rm " & (quoted form of POSIX path of the_file)
end delete_file
Thanks for any input.
Regards
--
DizzyPenguin * autoMAC-it
mailto:email@hidden
visit:
http://www.dizzypenguin.com/automac-it/
_______________________________________________
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.