I want to download a list of youtube videos and save with corresponding file names. All those data are stored in Excel 365 for Mac. The python has YouTube package to do it. So the natural idea is to write some vba, to execute a terminal command to run the python file like "python3 YTdownloader.py". Everything works fine when I directly run this command in terminal windows.
I know there is a so-called sandboxing restriction in VBA Excel 365 for mac, which prevents from directly execute terminal command in VBA using previously available MacScript. But according to MS document, we should be able to use AppleScriptTask to run Apple script functions with parameters. I leant and wrote an apple script file, put it into a right place required by the vba. It works perfectly when I run the apple script in script editor or Visual Studio Code (after installing the apple script interpreter), and downloaded youtube videos.
It does work to passing parameters to apple script via a string. But when I try to run a terminal command to run the python YTdownloader.py, there is run time error 5 in vba, saying wrong procedure call or arguments. (but it does work with exactly same parameter either in script editor or VS code, or in terminal). I thought I may have to grand Excel with access to all folders involved. So I did so by running GrantAccessToMultipleFiles. But unfortunately it still not work.
I would appreciate if someone can tell me any idea to overcome this.
Thanks
I know there is a so-called sandboxing restriction in VBA Excel 365 for mac, which prevents from directly execute terminal command in VBA using previously available MacScript. But according to MS document, we should be able to use AppleScriptTask to run Apple script functions with parameters. I leant and wrote an apple script file, put it into a right place required by the vba. It works perfectly when I run the apple script in script editor or Visual Studio Code (after installing the apple script interpreter), and downloaded youtube videos.
It does work to passing parameters to apple script via a string. But when I try to run a terminal command to run the python YTdownloader.py, there is run time error 5 in vba, saying wrong procedure call or arguments. (but it does work with exactly same parameter either in script editor or VS code, or in terminal). I thought I may have to grand Excel with access to all folders involved. So I did so by running GrantAccessToMultipleFiles. But unfortunately it still not work.
I would appreciate if someone can tell me any idea to overcome this.
Thanks