Add Operation to File Menu in an Applescript Application - applet

I have an application that was made with applescript for now I can substitute this for the code:
try
tell application "System Events"
delay 10
display dialog "blah blah"
end tell
end try
and I would like the user to be able to quit this application by either rick clicking on it and selecting "Quit" or by going to File>Quit. But I believe the try is catching the quit. Is there any way to do this?

You can't do what you ask. Even if possible, the delay statement stops everything for 10 seconds so it can't catch any "quit" actions. If you explain a little more about what you're trying to do then there may be another way to accomplish your goal.
Note also that in Yosemite the delay command isn't working properly. It's a bug. You can use this instead until the bug is fixed.
do shell script "sleep 10"

Related

Powershell Popup Message with timer

Hello my programming gods...
I'm trying to create a popup message with timer with powershell to include with SCCM scripts. This popup will be called if a program needing update is detected.
What I want is something like this that I found on the net:
Basically:
1- I want to be able to put a banner in the popup window.
2- The name of the program to be updated
3- Show a timer
4- When the timer is expired or the next button is pressed, the script would continue and installed the update.
I began thinkering with this tutorial: https://www.red-gate.com/simple-talk/sysadmin/powershell/building-a-countdown-timer-with-powershell/
So far the timer works but everything is pretty barebone. Am I on the right track? How would you go about it? Also, the popup window don't go to the foreground... Dunno what Im doing wrong.
I am not a programmer and I'm trying to do this as a favor for someone. I just don't really know how I should go about it. Maybe powershell is not the good tool for this?
It looks like you are looking for a tool such as below:
https://psappdeploytoolkit.com/
https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases
PS-App-Deployment Toolkit provides a set of functions to perform common application deployment tasks etc.
I use this myself for handy deployments to users within my workplace through SCCM.
See the above links for instructions and detail.

How to install/run autohotkey without admin privileges?

I followed this tutorial: http://www.thenickmay.com/articles/how-to-install-autohotkey-without-admin/
At Step #6, I opened AutoHotkeyU64.exe and it opened up the help file for AutoHotKey.
Then I went through the tutorial and tried out the script they give:
^j::
Send, My First Script
return
I saved this as tutorial.ahk, then opened a new notepad file and pressed ctrl+j. Nothing happened.
Anyone know what's going on? I've never used autohotkey before, btw.
Since I was able to install it normally, I can't say for certain, but I believe there is a skipped step (or two) in the instructions.
After step 5, run (double-click) your .ahk script. If you get a message asking
"How do you want to open this file", choose "More apps", then "Look for another app on this PC" (see image below), then navigate to and choose AutoHotkey.exe or AutoHotkeyU64.exe. Be sure to keep the checkbox checked to "Always use this app to open .ahk files" so that you only need to do this once on your machine.
I am late to the party and dunno if anyone's left drinking here, but I want to run ahk just to fix that darn copy/paste function on cmd/erp ... Hope this works

This error keeps showing up on my desktop

This Javascript error keeps showing up on my desktop, and when i delete it another one will pop up.
Can anybody with knowledge about this please help me?
Oh the image is on Danish so yeah. Translated it says that there was a script-error with the script, and asks if i still want to play the script on this site.
Solution Found
Go to Control Panel
Go to Programs and Functions
See if there is any program that refers to the url-error-message you got, and if there is, delete it.
Note If the program is a program that you need to have for running your system or just an important program, don't delete it, there could be other ways to fix it.
Other ways to fix it
1. Start up the installer that you used to install the program, if there is a button that says "Repair software/program" or something like that; tap the button.
If there isn't a button that says "Repair software/program" (or something like that); try to install the program again.

Applescript to wait for AppleMail to download messages.

Prior to 10.7.x this AppleScript used to work with AppleMail:
tell application "Mail"
activate
check for new mail
repeat until (background activity count) = 0
do shell script "sleep 1"
end repeat
end tell
However, since 10.7.x+ this does not seem to work anymore. It doesn't even go in to the repeat loop. My guess is that AppleMail has changed the way it downloads emails and doesn't use "background activity" anymore.
Anyone know how to wait for all emails to download in AppleMail 5+ with AppleScript?
I checked on 10.8.2 and it worked. Maybe the check is really fast on your system and it's already finished when the repeat until condition is evaluated. But I can't understand what's the objective of the script. Also, it would be better if you replace the do shell script "sleep 1" with a simpler delay 1.

eclipse stop popup "Web launch already running"

I am developing in PHP with Xdebug and for some reason every now and then the debug session stops working, so i click again the debug button but it gives me this error all the time "Web launch already running", so i have to go to Debug Perspective and click "Terminate and Relaunch".
Is there a way to make eclipse automatically terminate and relaunch or launch two sessions or don't show this popup, for 2 years this popup has been bugging me xD
As noted in response to questions like this one and this one, the best current solution appears to be binding "Terminate and Relaunch" to a keyboard shortcut.
Not automatic, but at least a lot less clicking around.
I have taken care of pesky popups in Eclipse with AutoHotkey script which have worked very well. I could create an AutoHotkey script which sends specific keystrokes automatically every time there is a specific pop-up.
So the flow I had in mind was as follows :
You click on the debug button -> The Error popup appears and as soon as that happens the AutoHotKey script kicks in and automatically does what you have to do manually.
If you think that might be worth looking into then we can talk more in a Chat session somewhere. I would need some information about the Pop up using the AU3_Spy.exe bundled with the AutoHotkey Installer.
Searching on Google, I found that many people have the same problem.
Bellow are some links that help you, I think:
https://aptanastudio.tenderapp.com/discussions/questions/123-definitive-installation-guide-for-php-debugging-on-linuxubuntu
A good article: http://www.latenightpc.com/blog/archives/2008/05/24/a-complete-lamp-development-environment-xampp-eclipse-pdt-and-xdebug
See this, too: http://www.eclipse.org/forums/index.php/m/57493/
Take a look here, too: Getting error in XDEBUG
So, read and try, read and try.