Re: 2 queries - file/creator type and do shell "rm"
Re: 2 queries - file/creator type and do shell "rm"
- Subject: Re: 2 queries - file/creator type and do shell "rm"
- From: Rob Jorgensen <email@hidden>
- Date: Thu, 26 Feb 2004 15:54:15 -0500
At 8:26 PM +0000 2/26/04, DizzyPenguin wrote:
Hi,
On OSX 10.2 and above, 2 quick questions...
One answer...
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
The script works for me in OS X 10.2.8. Does it help to add a slight
delay between writing the file and setting the file and creator types?
-- Rob
_______________________________________________
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.