AppleScript Newbie Problems

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

Moderator: Mr_Noodle

AppleScript Newbie Problems Fri Oct 21, 2016 5:50 am • by mtennes
Hazel constantly reports an error when attempting to run a very simple non-embedded AppleScript.
Code: Select all
property theFile : alias "Users:Michael:Desktop:DEVON.pdf"

tell application "Finder" to open file theFile
While, if I embed the tell "Finder"... line it works in Hazel.

What am I doing wrong? Ultimately, I want to automatically store various PDF's in DevonThink Pro Office.
mtennes
 
Posts: 5
Joined: Fri Oct 21, 2016 5:43 am

Re: AppleScript Newbie Problems Fri Oct 21, 2016 10:34 am • by Mr_Noodle
If writing an external script, you must use a special handler. Consult the help as it has a template there.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: AppleScript Newbie Problems Sun Oct 23, 2016 8:24 pm • by mtennes
Mr_Noodle wrote:If writing an external script, you must use a special handler. Consult the help as it has a template there.


It appears this is a limitation within Hazel using the OSA Applescript component rather than the Generic OSA component. See discussion below.

http://forum.latenightsw.com/t/debugging-hazel-applescript/331/6
mtennes
 
Posts: 5
Joined: Fri Oct 21, 2016 5:43 am

Re: AppleScript Newbie Problems Mon Oct 24, 2016 11:07 am • by Mr_Noodle
I'm not sure the comment is correct. Hazel does use the generic OSA APIs (which is how it can support JavaScript as well). Also, that has little bearing on why there is a separate handler, which is by design.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: AppleScript Newbie Problems Sat Oct 29, 2016 10:20 am • by mtennes
Mr_Noodle wrote:I'm not sure the comment is correct. Hazel does use the generic OSA APIs (which is how it can support JavaScript as well). Also, that has little bearing on why there is a separate handler, which is by design.


I am absolutely sure my previous comment was not correct. Hazel scripts do work with Script Debugger when it's set up correctly. Make sure your have the ~/Library/Components directory in place with correct permissions before running Script Debugger (my problem.)
mtennes
 
Posts: 5
Joined: Fri Oct 21, 2016 5:43 am


Return to Support