Well the first thig to say is that f you have saved your script as a stay open script, then the script never quits until you shut down the computer, so it may be keeping the values of your variables for that reason, so check that you have not saved as a stay open app.
Secondly as Regulus6633 has suggested, try moving your qutoted form of statements into the do shell script command, instead of the set Path_2 variable line.
Also don’t use alias types when using shell script commands, try sticking to text types.
I have re wrote a script that does what your script does, but only uses one shell script command, whenever possible dont use shell scripts as they only need one wrong bit of typing to cause problems.
I have not used the unzip unix utility, so I have to trust that you have typed it in correctly.
Instead I have used Finder to move the font files to the /Library/Fonts, if you have a tell Finder block you may as well get Finder to do as much as it can for you.
[code]on run
tell application “Finder”
set zip_folder to POSIX path of (folder of (path to me) as text) as text
set zip_file to zip_folder & “4Fonts.zip” as text
my unzip_file(zip_file, zip_folder)
delay 0.5
set desktop_fonts_folder to (path to desktop as text) & “Fonts” as alias
set library_fonts_folder to (path to library folder as text) & “Fonts” as alias
move (every file of folder desktop_fonts_folder whose kind contains ¬
“font”) to library_fonts_folder with replacing
end tell
end run
on unzip_file(zip_file, zip_folder)
try
do shell script "unzip -u " & quoted form of zip_file & " -d " & quoted form of zip_folder
on error error_message number error_number
display alert error_message & space & error_number message ¬
“An error occured while trying to unzip the zip file,” & return & ¬
“check that the do shell script command syntax” & return & ¬
“has been typed correctly.” as warning
end try
end unzip_file[/code]
Notice that I have moved the do shell script command out of the tell block, and put it in its own handler, and also added some error checking into that handler, to catch any problems in the shell script command.
I have also added a half second delay after the unzip_file handler call, this is always a good idea with shell script commands, as they take some time to complete, and you dont want the script goining to the next line of code, until the shell script command is fully completed, you can remove this delay command line if it works fine without it, or increase the delay time if errors occur.
Remeber that if you want to point at a different zip file, then change the “4Fonts.zip” name assigned to the zip_file variable to the new zip file name, and also the zip_folder variable will have to be changed if the new zip file resides in a different folder.
You might want to consider adding a on open handler to your script, that way you could drag and drop a zip file onto your compiled script, and have it run the code on the dropped file.
Try these suggestions and let me know how you get on.
Regards Mark