1

I saw this question has been asked before but not answered. When using tcltk::tk_choose.files() the first time during an R session it opens behind the R main window. All further times it opens in front of the main window (as it should!). Is there a way to have it always in the very front? Ultimately I would like to use it via shiny as below. So it should also be in front of the shiny window.

library(shiny)

ui <- fluidPage(
    actionButton("do", "Open window")
)

server <- function(input, output, session) {
    observeEvent(input$do, {
        tcltk::tk_choose.files()
    })
}

shinyApp(ui, server)

I am aware of base::file.choose() and utils::choose.files(). However, the first does not allow to select multiple files at once and the second does not allow to copy/paste paths for quicker navigation which drives me crazy,..

yasel
  • 433
  • 3
  • 13
  • Have you tried with `base::file.choose()` and/or `utils::choose.files()`? – Tomas Capretto Oct 10 '20 at 02:29
  • 1
    Thank you. I am aware of those but would like to avoid them. I updated my question to explain why – yasel Oct 11 '20 at 11:49
  • I'm using Windows and it works fine from the R session. When using from shiny, it fails. Sometimes it works, sometimes it doesn't. Also, it crashes my RStudio session. – Tomas Capretto Oct 11 '20 at 14:55
  • Oh ok. I realized by now that on some computers (all windows7) it seems to always open in the front, on others it is as described above. However, for me it never crashed – yasel Oct 11 '20 at 15:55

0 Answers0