AppleScript - alert window issue when using launch command - dialog

I have downloaded an application from internet(from Chrome browser) named "a.app", and there will be an alert window shown if I launch it, see the bellow figure.
The problem is, when I double click on a.app, the alert dialog will show up immediately, but if using the following AppleScript, the dialog will wait up to 20 seconds before it appears.
tell application "a.app" to launch
20 seconds go beyond my patience, so I wonder if it is possible for AppleScript to perform just as manually double click on a.app, that is, how to show up the alert dialog the moment I launch a.app by way of AppleScript.
Any ideas, thanks in advance.

Two options:
Remove the quarantine after downloading the App (like Asmus mentioned):
do shell script "xattr -r -d com.apple.quarantine /path/to/the/dmg"
Permanently disable the warning by running this AppleScript line once.
do shell script "defaults write com.apple.LaunchServices LSQuarantine -bool NO"

Related

Why my python script sometimes stopping and waiting for keypress?

I noticed something on my script. Sometimes it stops and when I press any keys on my keyboard it resumes. I didnt put any keypress command on my script. It's running on a windows vps.
Any idea why is this happening?
I found the issue. When i clicked on the terminal the script pauses. To fix this go to terminal properties then uncheck the quick edit.

excel application is not shown in task manager when It is opened

I am developing a little app that works with excel books, when I run it, it opens a excel book, I ran this code in windows 7 and the excel app was shown in task manager but I ran it again in windows 10 and a it was not shown in task manager.
I want it to be shown in task manager because sometimes the code crashes so I need to close the app from the task manager. I think it is a problem related to SO.
Do you know how to solve it?
enter image description here
enter image description here
enter image description here
Open Powershell as admin and type get-process. Verify that the Excel process is running, and type stop-process -Name Excel and press enter.
Good to go.
I bet you're looking at the Applications tab, not going to the Processes tab.
Press Ctrl+Alt+Del . (an alternative is Ctrl+Shift+Esc on many systems.)
Click Start Task Manager
Click the Processes tab. (#1 in the image below)
Click the Row Heading Image Name (to sort the processes alphabetically) (#2 in image)
Scroll down (#3) the list of images until you get to the 'E' section.
If Excel is running, you will see at least one process named EXCEL.EXE (etc)
If you still can't find it, please take a screen shot of the Processes tab, and add it to your question, along with more of an explanation of why you think it should be showing.
Remember that the best way to remove all running processes and "refresh everything" is to reboot. Every computer should be rebooted at least once a day -- or much more often than that when troubleshooting buggy programs. Or in your case, Reboot every time Excel crashes.
More Info:
Task Manager (Windows)
Finally, I solved it, I just had to update the task manager by pressing the key F5 each time I run a new program, I think it is a bug.
Anyway, Thanks for your help.

Any reason that zenity wouldn't bring a dialog into focus?

I am using Zenity 3.10.2 and any time I use Zenity, regardless of dialog type, the dialog it brings up has focus. i.e. I can straight away press "Enter" straight away and proceed. (I need this ability for automation)
However, there is one exception and it is very difficult to test. It occurs during the KIWI installation of a custom Linux distro and involved a question dialog being created with no focus. Neither enter nor tab have any effect.
There is a bash script which creates this dialog. When I run this in all other contexts, It has focus, but in this install it does not, the cursor appears in random places all around the place. However, from what I can see, the whole point of Zenity is on-top, already focused dialogs.
The actual call to create the dialog is the result of sourcing a file that has the bash script in it i.e. ". ~/.bashrc". Even this approach, always works when I test it manually.
Any ideas as to what could cause a Zenity dialog to be created without focus? Or any way using just Zenity to reclaim / change the focus?
I am aware you can use a window manager such as wmctrl to bring the Dialog to the focus. However this currently not a used package and shouldn't have to do anything else as this is just a simple dialog.
WINDOWMANAGER=/usr/bin/gnome-session
Any guidance would be much appreciated!

Launch Screen may not have connections

Getting this error while trying to compile and run app.
Since the only work I have done is on the XIB file, I have tried removing the value from the launch screen file box, still it didn't help.
Here's a screenshot:
http://i.imgur.com/mCtsdUr.png
Using Xcode 6.1.
If you set outlet connection with any of the object of launch screen then it's give this types of error.Simply launch screen has a plain(static) UI. You can not change it's value run time or using creating UIViewcontroller. So, remove all outlet connection of launch screen. If you want remove Launch Screen then go to General setting tab then clear value of Launch Screen file. Make sure it's also clear into the info.plist file.

PyDev, PyUnit Usage Questions

In the PyUnit view in Pydev...
Suppose the view currently shows 5 tests, 1 of which fails.
When I right click on the failed test, and then run it (with either Run or Debug), all the other tests disappear from the view. How do I stop it from removing all the other tests?
Next question.....
Also, Pydev then creates a run configuration for the test that I just ran. Which means that if I right click on the test module in the PyDev Package Explorer, and then try to "Run As" "Python Unit Test", I then have to select which run configuration. How do I stop it creating a new run configuration?
When you right-click a failed test and run it, you did a new run configuration that just ran it alone (so, you get the results just showing that one).
What is implemented is that you have a 'pin' icon in the pyunit view. You can click it to 'bookmark' the run, so, when you press the 'reload', which is the icon in the right of the pin, it'll reload those results (or you can manually choose the results from any run from the test run history dropdown).
As for running, there's no way to stop it from creating a new run configuration, but what you can do is just re-run the last one with Ctrl+F11 (provided you configured it properly as explained in http://pydev.org/manual_101_run.html).
You can also access old runs with Alt+R, T > number from 1 to 9 an old configuration you want to run.
Even though it is possibly not the exact approach you may expect, one option is to start the Unittest from the command line and attach the debugger by RemoteDebugServer via 'pydevd.py'.
This is now a fully automated option of ePyUnit which includes the automation of remote debugging with PyDev and Eclipse by 'pydevd.py'. This works seamlessly for the 'subprocess' call as well as independently started command line processes.
See:
https://pypi.python.org/pypi/epyunit
https://pythonhosted.org/epyunit/
For basics of remote debugging:
http://www.pydev.org/manual_adv_remote_debugger.html
Also enhanced unittest integration into PyUnit.
Comments and fixes are welcome.
Have fun..

Resources