Delete and replace

I need a script that will ultimately be in a Package made by Composer. The script needs to change the bootup screen to a different .jpg that I have created. I tried creating a shell script within AppleScript to just do a rm of that folder and then use Composer to place a new BootScreen folder with my file back into it.

When I run the script and enter my password I get: rm: /Library/Application Support/BootScreen: is a directory and a OK button. Can anyone tell me why I get this directory error or have a better way to do this. Thanks for any help!

AppleScript: 2.1.2
Browser: Safari 533.17.8
Operating System: Mac OS X (10.6)

Hello

Try:

rm -d /Library/Application Support/BootScreen

I need this to run in AppleScript. I tried cutting and pasting into AppleScript and Terminal and just got a bunch of errors. Got this from AppleScript:

error “rm: -: No such file or directory
rm: d: No such file or directory
rm: /: is a directory
rm: Library: is a directory
rm: /: is a directory
rm: application: No such file or directory
rm: support: No such file or directory
rm: /: is a directory
rm: BootScreen: No such file or directory” number 1

Got this from Terminal:

rm: /Library/Application: No such file or directory
rm: Support/BootScreen: No such file or directory

I’m sure I’m doing something wrong.

Hello.

You must have forgot the dash in front of the d.

I’m doing a cut and paste into AppleScript of: rm -d /Library/Application Support/BootScreen

When I try run I get: error “The variable rm is not defined.” number -2753 from “rm”

Hello

Try this: :slight_smile:


do shell script "rm -d " & quoted form of "/Library/Application Support/BootScreen"

Please tell me how it went.

in the command line paths containing spaces must always be escaped or quoted

rm -d /Library/Application\ Support/BootScreen or rm -d '/Library/Application Support/BootScreen'

I cut and paste: rm -d /Library/Application\ Support/BootScreen into AppleScript Editor and I get: Expected expression, property or key form, etc. but found unknown token.

I cut and paste: rm -d ‘/Library/Application Support/BootScreen’ into AppleScript Editor and I get: A unknown token can’t go after this identifier.

The code above is directly for the command line.
McUsr posted the AppleScript equivalent

Hello.

I’m sorry for taking things for granted. I really should have written that you should have entered the statements into a do shell script command, after having confirmed that it worked on some directory from terminal.

Thanks for helping me out Stefan :slight_smile: