• 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
2 queries - file/creator type and do shell "rm"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: 2 queries - file/creator type and do shell "rm"
      • From: steve harley <email@hidden>
    • Re: 2 queries - file/creator type and do shell "rm"
      • From: Emmanuel <email@hidden>
    • Re: 2 queries - file/creator type and do shell "rm"
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Re: Results differ in editor and applet
  • Next by Date: editing HTML
  • Previous by thread: Re: InformationWindow: How do I get info from ...
  • Next by thread: Re: 2 queries - file/creator type and do shell "rm"
  • Index(es):
    • Date
    • Thread