feil på kompilerings-/kjøringsscript i BBEdit

feil på kompilerings-/kjøringsscript i BBEdit

Innleggav mac_Lars » man 07.11.2011 13:54

Jeg har lenge brukt TextWrangler fra BareBones for å skrive Java. Siden TextWrangler ikke har en integrert kompiler/kjør-funksjon lastet jeg ned to AppleScripts som gjorde dette i Terminal for meg.
Jeg gikk nylig over til BBEdit for å gjøre det samme, og endret scriptet fra "tell application TextWrangler" til "tell application BBEdit" i håp om at det var så enkelt. Problemet er at jeg får følgende feilmelding når jeg prøver å kjøre/kompilere med disse scriptene i BBEdit:
Bilde

Jeg legger også ved scriptene:
Kompiler:
Kode: Merk alt
tell application "BBEdit"
   save text document 1
   set the_file to file of text document 1
end tell

set AppleScript's text item delimiters to ":"
set source_file to the last text item of (the_file as string)

tell application "Finder"
   set the_folder to container of the_file as alias
end tell

tell application "Terminal"
   activate
   set shell_script to "cd " & (quoted form of POSIX path of the_folder) & ¬
      "; javac " & source_file
   if (count windows) is 0 then
      do script shell_script
   else
      do script shell_script in the front window
   end if
end tell


Kjør:
Kode: Merk alt
tell application "BBEdit"
   set the_file to file of text document 1
end tell

set AppleScript's text item delimiters to ":"
set source_file to the last text item of (the_file as string)
set compiled_file to text 1 thru -6 of source_file

tell application "Finder"
   set the_folder to container of the_file as alias
end tell

tell application "Terminal"
   activate
   set shell_script to "cd " & (quoted form of POSIX path of the_folder) & ¬
      "; java " & compiled_file
   if (count windows) is 0 then
      do script shell_script
   else
      do script shell_script in the front window
   end if
end tell


Hvis noen har erfaring/kan hjelpe meg med dette hadde det vært veldig fint! :)

På forhånd takk!

Brukerens avatar
medlem i 217 måneder
 

Returner til Java



Hvem er i Forumene

Registrerte brukere: Google [Bot]