Customize Print Dialog for windows desktop system users - dialog

Is there a way to customize the default Print Dialog on Windows Desktop, for all system users. This is not within the context of a specific application, but instead will be for all users that log in to the workstation and uses any application and issues a "Print".
As part of a Green initiative, our organization wants to reduce wastage of Print paper. So we want to display a YES/NO message box that says something similar to "Please consider if you really want to continue printing. Save paper...Save Environment. Continue?"
If the user clicks "Yes" , then the Print Dialog display is resumed and user can continue. If user clicks "no", then no further action is needed and system does not display Print dialog.
Thanks

Related

Gnome 3 Disable "Unlock private key" modal GUI

I am using Gnome 3.34.3.
When I need to unlock a private key (ssh, git, etc.), a modal window appear and ask me to write the key's passphrase.
The GUI is modal and it is not convenient for me.
I would like to unlock my private keys from either the terminal or a not modal GUI.
Is it possible ?
Thank you !
echo "pinentry-program /usr/bin/pinentry-gtk" >> ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye
Almost solved.
In short; no. [sorry]
The dialog is kept modal to mark its importance. For example, such password, urgent info windows must be kept modal to get the user's attention as soon as possible. Modal also prevents you from accessing the other part of application, which otherwise would spoil the application entirely.
For example:
if the dialog wasn't modal while getting authentication, there is no meaning at all. The dialog could be just kept down by the window manager without you even knowing it. There are possibilities.
I agree, modal windows are irksome as many crazy developers use it for everything (You can read more about this on GNOME's HIG guidelines), but a dialog should be modal when it has to be.
It depends on the developer to choose what should be modal and what should not be. That is it depends on the application, and there is no system wide settings available to change that behavior. You can, so, ask the respective developer to replace the modal windows with convenient ones.
To your question of accessing it from terminal, it also depends on the application.

Choregraphe red dialog box error when running the robot

Can anybody explain to me what the problem seems to be with one of my dialog boxes. All the other dialog boxes, which were created in the same way and are on the same access level are fine, but this one keeps going red when ever I launch the robot and so it does not let me enter the topic through input.
This is the error displayed: https://prnt.sc/mhnv3s
Hard to tell without seeing the whole program, but it looks like you have two dialogue boxes which both refer to the same .top file, and which are both active at the same time.
When you trigger the "start" of the dialog box, it will stay active until either a) you trigger it's "stop", or b) the whole diagram in which it is is stopped (which will happen if you "exit" it, but not when a sub-diagram is activated).
Another possibility is that this dialogue is flagged as being collaborative dialogue, which means it could be loaded by the system while the robot is in autonomous life, and then re-launched again by your dialogue box.

applescript display dialog with custom icon

Is there a way to use custom icons with applescript display dialog and notifications?
In the AppleScript documentation it says about the display dialog:
with icon (text | integer)
The resource name or ID of the icon to
display.
with icon (stop | note | caution) The type of icon to show.
You may specify one of the following constants:
stop (or 0): Shows a stop icon
note (or 1): Shows the application icon
caution (or 2): Shows a warning icon, badged with the application icon
with icon (alias | file) An alias or file specifier that specifies a .icns file.
So it seams like you can use your own icons, but I cannot get the following code to work.
display dialog "Text" with icon "/Users/user/Desktop/asd.icns"
It gets me the following error: "Resource not found."
The goal is to not even use a display dialog, but a display notification instead.
First of all you can't display a custom icon with display notification. The reason is that notifications are strongly related to a target application. As AppleScript scripts and applets aren't applications in terms of the Notification framework, the notification is related to the current application, the AppleScript Runner.
But you can display a custom icon with display dialog
The line
with icon (alias | file) An alias or file specifier that specifies a .icns file.
means what it says: The parameter must be an alias or file specifier rather than a POSIX or HFS string path.
Either
display dialog "Text" with icon alias ((path to desktop as text) & "asd.icns")
or
display dialog "Text" with icon file ((path to desktop as text) & "asd.icns")
path to desktop as text represents the HFS path to the desktop of the current user:
"Macintosh HD:Users:user:Desktop:"
Noted this question was three years ago, but I stumbled across this looking for a solution to a similar problem. Mine needs display alert rather than ... notification but the problem is the same because display alert doesn't have a custom icon option.
As noted in the other answer here, AppleScript has at least three interactive message type commands: display dialog, display alert, display notification, and probably others. It seems odd that only the first has the option to add a custom icon. I don't really understand why that is when it would be simple to make them consistent.
Needless to say, this question and #vadian's answer, inspired my solution - a "duh" moment for me once I realized it. It may or may not be a solution to this question. Posting it in case it is...
If the icon in question belongs to an app, you can tell that app to display the notification, regardless of whatever else your script is doing.
Your script can do whatever it needs to do to whatever other apps, or System Events, or itself (if your script is saved as its own application), or whatever else. In the middle of all of that you can have a single line that says:
tell application "MyApp" to display notification ...
The notification will have My App's icon, the result of the notification if any will be returned to the rest of the script and then your script will continue on inside whatever other tell statement or context its in.
If your icon isn't the icon for an app, then I believe there are ways to create an empty app with whatever icon you like, which can behave this way. Admittedly that's a bit of a kludge, but depending on how badly you want this, it's an option - though not one I'll expand on here.
My specific case in detail if interested (but doesn't particularly add to the solution above, just covers how I got there):
I'm writing a script that quits and re-opens another application after confirmation from the user. However, let's say I just wanted to provide a notification as per this question.
Options:
1. display dialog - has the option to provide a custom icon but lacks features of the other two options.
2. display alert - no custom icon but has other desired features, in my case the message parameter which adds extra smaller explanatory text below the primary text.
3. display notification - no custom icon but has other features as desired by this question's poster.
In my case I want alert because I want that extra message parameter (but this works for notification as well).
In my case, ideally the icon of the alert would be the icon of the app I'm restarting, but I can't tell the app itself to display the alert and then restart because the script loses connection with the app when it quits and it kills the running of the script.
If I tell System Events or the script itself to do all that then it can quit and reopen the app independently of the app, but the alert has the generic icon of itself or the System Events icon.
However, if I do what I described above - have my script do all its stuff, but have it tell the app in question to display the alert (and only that as described above), then the alert has the icon of the app in question, but the script still does its stuff independently of the app outside of that alert.
Solved my problem. May or may not solve this question.
#DavidT's answer is a perfect solution when your script is controlled by another application. However, things have changed a bit on Mac OS since.
Notably, if you run your script with tell application "MyApp" to display alert ... you will be promoting the user to give your app permissions to control itself, at least starting since Catalina. Not only this annoys the user with a new permission request, but it also looks kinda dumb since the dialogue is asking the user to allow "MyApp" to control "MyApp" and if the user denies it, your script will fail.
To avoid the permission request, just use tell me to display alert ... this will work just fine.
Another issue you might run into is that osascript may throw an exception if your script is launched as root. I found a nice workaround for that here.
This is a small example of how to launch the dialogue with the right user:
uid=determineUserIdFunction(...)
launchctl asuser $uid /usr/bin/osascript <<-EOS
tell me to display dialog "Now you see me" buttons {"OK"} default button 1 with title "WARNING!"
EOS
You have your path specification wrong. If you have a posix path to your icns file, use the POSIX file class coercion:
display dialog "Text" with icon POSIX file "/Users/user/Desktop/asd.icns"
This coerces the string path into a file reference the system understands, and works just fine.

NSIS: How to distinguish between Cancel and Close button

In NSIS, on a custom page, I want to skip the page when the user presses the Cancel button, but I want to exit the installer (with confirmation) when the user presses the window's X button. How do I do that?
Currently, by using Modern UI and custom abort function, I get the same function called regardless of which of the two buttons is pressed.
This is not normal installer behavior and I would not recommend that you try to implement this.
If you still want to try I guess it might be possible with the ButtonEvent plug-in or the WndSubclass plug-in...

Simulating user activities on a GMail page

I create a program that simulates me browsing to gmail, entering the user name and password and clicking the submit button.
All this with C#.
I would appreciate two kinds of answers:
One that tells how to do this programaticaly. Since I may be interested in automating more
sophisticated user activities.
On that tells me about a program that already does that.
Thanks!!
I want to access my mail account with a double click (without browsing, entering username and password and pressing submit).
Why not check the 'stay signed in' box, and add a bookmark toolbar item for Gmail?
alt text http://img192.imageshack.us/img192/6240/picture5zw.png
Do it once, and all future logins are a one-click process. Am I missing something? Why overcomplicate this with a C# program?
Well, depending on the browser you're using, it might be much simpler to use a greasemonkey userscript (on FireFox) that does auto-login for you.
If you want to simulate user activity take a look at AutoHotKey.
Also if the issue is specific to logging into websites take a look at LastPass. They have plug-ins for every major browser and mobile device. I haven't type out a user name or password on a website in months.
If your ok with clicking 'go' (or wharever) on your application and then clickingin the username field. Look into Sendkeys:
Put this in the onClick event of a button and replace text with your user details:
SendKeys.Send("USER#DOMAIN.COM{TAB}PASS{TAB}{TAB}{ENTER}");
You might also want to put a timer or make your program wait a few seconds before actually sending the keys to give you time to click in the username box.
Use WatIn. and this is a placeholder to get to 30 Chars answer

Resources