Compiling embedded script (bug?)

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Compiling embedded script (bug?) Wed Dec 12, 2012 8:44 pm • by eN0ch
Enter the following in AppleScript Editor:
Code: Select all
tell application "iPhoto" to activate
end
tell application "System Events"
   set visible of process "iPhoto" to false
end tell

Press 'compile'
Result: passed without errors

Enter exactly same in Hazel's script edit panel, and press compile button
Result:
Image

Is this a bug, or am I missing something? Thanks.
Lance <º))><

iMac 24" 2021 M1 | macOS 14.4.1 | Hazel 5.2.1
eN0ch
 
Posts: 63
Joined: Tue Jul 01, 2008 7:41 pm
Location: Crookwell, NSW, Australia

Re: Compiling embedded script (bug?) Thu Dec 13, 2012 2:11 pm • by Mr_Noodle
Odd. I'll look into it. I suggest emailing support in case I am able to come up with a test build for you.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Compiling embedded script (bug?) Thu Dec 13, 2012 4:16 pm • by Mr_Noodle
Ok, looking at it more closely, I think the bug is actually with AppleScript Editor. You have an extra "end". When you do:
Code: Select all
tell application BLAH to DO SOMETHING

That is a self contained line. Contrast with:
Code: Select all
tell application BLAH
   DO SOMETHING
end tell

Hazel picks it up because embedded scripts are, well, embedded within a handler so there's an extra "end" at the end, if you follow me. So, the fix here is to get rid of that first "end".
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Compiling embedded script (bug?) Thu Dec 13, 2012 9:02 pm • by eN0ch
Thanks Paul. I'll see how that goes. But running in AS editor, it needed the "end" added for the hiding bit to work.
Lance <º))><

iMac 24" 2021 M1 | macOS 14.4.1 | Hazel 5.2.1
eN0ch
 
Posts: 63
Joined: Tue Jul 01, 2008 7:41 pm
Location: Crookwell, NSW, Australia


Return to Support