10
$\begingroup$

I could bet it used to work, now the following code fails 95% of times:

RunScheduledTask[Echo @ SystemOpen @ "https://www.wolfram.com", {1}]

Can you reproduce the problem? Is there a workaround?

Reproduced on V11.3, Win10 and OSX Mojave

A support case with the identification [CASE:4177940] was created.

$\endgroup$
  • 1
    $\begingroup$ Wild guess: doesn's SystemOpen require an FE? Update: Yes it does, maybe the problem is related to that. I can confirm the problem BTW/ $\endgroup$ – Szabolcs Oct 26 '18 at 12:33
  • $\begingroup$ @Szabolcs Yes it does but UsingFrontEnd does not help. It is not really needed, you can do FrontEndExecute @ FrontEnd`SystemOpen@... and you will see it gets there (it returns False though). Weirdly, I think it was working well even in 11.3 because it was part of an app I created and no one complained so far. So maybe a recent paclet update? $\endgroup$ – Kuba Oct 26 '18 at 12:42
  • 1
    $\begingroup$ It does not work in 11.1 on macOS High Sierra. $\endgroup$ – Szabolcs Oct 26 '18 at 12:45
  • 3
    $\begingroup$ There is currently no workaround. $\endgroup$ – ihojnicki Oct 26 '18 at 13:33
  • 3
    $\begingroup$ @Kuba the FrontEnd has an audit system. It is used by Dynamic, the old web browser plugin, etc... When you call something in the FE that interacts with the system, it wants to know where it came from. ScheduledTasks breaks that link. Your suggested workaround works but it assumes you have the rights to a.) create the dialog box and b.) have rights to run dynamics in that dialog box. So it would be satisfactory for a lot of use cases, just not all of them. $\endgroup$ – ihojnicki Oct 26 '18 at 14:00
5
$\begingroup$

Here is a temporary fix:

RunScheduledTask[
  CreateDialog[
    Dynamic[SystemOpen @ "https://www.wolfram.com"; NotebookClose[]]
  ]
, {1}
]

CreateDialog seems to work so we launch it and as soon as it appears Dynamic runs SystemOpen and closes parent dialog. On faster machines you may not even notice the dialog and otherwise the browser popup will be distracting anyway.

$\endgroup$
  • 1
    $\begingroup$ Will Visible->False break this? If it does, the trick with DynamicModule and Initialization might work, too. $\endgroup$ – b3m2a1 Oct 26 '18 at 19:22
  • 1
    $\begingroup$ @b3m2a1 I wrongly assumed it will but it seems that the very first evaluation is run anyway. Thanks. $\endgroup$ – Kuba Oct 26 '18 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.