Non-blocking Dialog box in Applescript

依然范特西╮ 提交于 2019-12-10 16:38:47

问题


I have to write a small script to deploy a patch for our Application. The patch will replace a couple of files in the application.I decided to depploy the patch using Applescript. The files to be copied are quite large and it takes some time for the files to be copied. I wanted to know if there is any way I can get a dialog box which doesn't block the execution of the script so that I can display some message like Updating.. etc while the patch is applied and then close the dialog box after wards.

Thanks Shivaprasad


回答1:


There's a scripting addition called Akua Sweets (oldy but goody) that has a display progress command. Get it at osaxen.com. it's in the 'most popular' section at the top of the page.

edit Oh, bugger, that's only for OS9. It was really useful back in the day, I remember using it a lot (of course everything took a lot longer in those days so progress bars were more in demand).

another edit You got me inspired, there's a couple of scripts I use that need progress bars, so I went looking and found this scripting addition at http://osaxen.com/files/extrasuites1.1.html

and again here's a basic tutorial for how to do it in interface builder. I think that's probably the right way to do it.




回答2:


I myself ran into the same problem. Unfortunately applescript doesn't provide an easy way of implementing a progress bar.

I ended up using the stop loop example found here to build an application. This guy has a bunch of applescript studio xcode projects to download and mess around with. It's some really great sample code if you aren't too familiar with applescript studio.



来源:https://stackoverflow.com/questions/1068181/non-blocking-dialog-box-in-applescript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!