saveAs is not a function - acrobat

I have a button in acrobat form with below script in the Mouse Down.
try
{
app.saveAs("/c/temp/11.pdf");
}
catch(err)
{
app.alert(err.message);
}
when I click on the button I get message box says
app.saveAs is not a function.
What is wrong?

You want doc.saveAs() See tutorial: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

Related

Vuetify combobox not getting focus after clicking cancel on dialog

I have a v-combobox component in my app. I have it to where I can type something in the input then #blur a check happens to see if the typed Item exists in the list or not. If it does not exist a modal opens up asking the user if they want to add it to the list.
I have it if the user clicks yes it is added to the list the problem I am having is if they click cancel and the dialog is closed focus should go back to the combobx input
When I try and set the focus I get the blue animation bar but no input cursor in the input of the combo box
I have set up a codesandbox example of my issue
CodeSandbox Example of Issue
I was wondering If i could get some help or pointers on why Im not getting the full focus to be able to type after clicking cancel on the dialog .
You can try to use $nextTick like this:
closeConfirmationDialog() {
// const comboBox = this.$refs[this.forInput];
// comboBox.$el.querySelector("input").focus();
this.showDialog = false;
this.cancelDialog = true;
this.$nextTick(() => {
this.$refs.categories.focus();
});
}

Wix element comes on and off when I hover on it?

I'm building a website using Wix.com and I'm trying to add a feature with code. I want a button to appear only when I hover over a document on the page. So far the button appears the way I want, but when I try to click on it, it keeps flickering so it's hard for me to click it.
I'm pretty new to this so I just tried basic debugging But still I don't know why this is happening. Also, I couldn't find much help from Wix forum
here are the code and a screenshot from the site (code examples is the button)
let rollLeft = {
"duration": 200,
"direction": "left"
};
let rollRight = {
"duration": 200,
"direction": "right"
};
$w.onReady(function () {
//TODO: write your page related code here...
});
export function document15_mouseIn(event) {
//Add your code for this event here:
if(!$w('#button1').isVisible)
{
$w('#button1').show("roll", rollLeft);
}
}
export function document15_mouseOut(event) {
//Add your code for this event here:
if($w('#button1').isVisible)
{
$w('#button1').hide("roll", rollRight);
}
}
Without seeing it in action this is a bit of a guess, but it looks like when you move to the button, you leave the pdf, causing the button to hide.
I can think of at least two ways to get around this:
Add a delay to the effect options to give a user enough time to click the button before it starts to disappear.
Add a transparent box beneath the file icon and the button. Use that box to trigger the show and the hide on hover, instead of the file icon. That way the hide won't trigger when the user tries to click the button.

Selenium Webdriver cannot click on modal dialog when the window is not in focus

I have 2 browsers open and Selenium Webdriver can switch between these two. One window is in foreground and other is in background. And in the workflow, a modal dialog opens up in the background window and thus webdriver cannot perform any actions on it. Is there any possible solution apart from getting the background window into foreground?
I am using C#.
Loop through your window handles and check for you modal dialog to appear.
string current_window = driver.CurrentWindowHandle;
foreach (string window in driver.WindowHandles)
{
driver.SwitchTo().Window(window);
if (GetModal())
{
//do actions here
break;
}
}
driver.SwitchTo().Window(current_window); //To put you back where you started.
private bool GetModal()
{
Try
{
IWebElement modal = driver.FindElementByXPath("");
return true;
}
catch
{
return false;
}
}
Based on what you put this should work. If you can't find the modal then there is probably a different issue than just the window not being in focus. If you are worried about other errors then I would say catch only the specific error in the catch and let everything else float up ElementNotFound exception.
I am using below code
try{
//your code which will generate Modal Dialog
} catch (Exception e) {
if (e.getMessage().contains("Modal dialog present")) {//For Handling modal dialog in firefox
(new Robot()).keyPress(java.awt.event.KeyEvent.VK_ESCAPE);
(new Robot()).keyRelease(java.awt.event.KeyEvent.VK_ESCAPE);
}else if(e.getMessage().contains("unexpected alert open")){//For Handling modal dialog in chrome
driver.switchTo().alert().accept();
}
}

on(release) {...} or myButton.onRelease = function() {...} - action script 2 issues

I am having real confusion with some flash banners I'm creating and making the button into a clickable object which opens a web page.
I have been using this code for a while below, which works...
on(release){
getURL("http://www.the-dude.co.uk", "_blank");
}
And I placed this code on actual button within the actions panel
However I have been told the code above is very old and that I should use action script like below...
buttonInstance.onRelease = function() {
getURL("http://www.the-dude.co.uk", "_blank");
}
So I've tried to get this method below to work but nothing happens when I click the button, and I get one error, this...
So in a nutshell I cannot get this newer code to work! Ahh
Can anyone please help me understand where I am going wrong?
I have tried placing the new code in the Scene 1 of my actions. No worky..
And I've also tried placing the code below, actually on my button within the actions panel...
this.onRelease = function() {
getURL("http://www.the-dude.co.uk", "_blank");
}
Still not working.
My scene settings are alway this...
Any help would be great thanks.
You need to place the code below on the same timeline as the instance of the button (as you tried). And the instancename of the button must be "buttonInstance".
You can set the instance name in the properties panel when the button is selected.
buttonInstance.onRelease = function() {
getURL("http://www.the-dude.co.uk", "_blank");
}

how to prevent window from closing on ESC extjs 4

I am stuck with one problem with one problem in stop the window from closing using ESC button.
The window gets closed as soon as I click the ESC button from my keyboard. I want the window should not close, instead it should prompt a message box asking 'YOU REALLY WANTS TO close' with two button yes or cancel
If person click yes button the the window should destroy and else the window should be as it is.
but don't know why the window is getting close on ESC press.
I am prompting message as the user click the esc button using below code
listeners: {
show : function(win) {
Ext.create('Ext.util.KeyNav', win.getEl(), {
"esc" : function(e){
alert('hi.. closing');
win.hide();
},
scope: win
});
}
}
now I want the message box to be appeared and based on the person answer things to be happend.
any help ??
There is very convenient onEsc function in window's config. Use it this way:
onEsc: function() {
var me = this;
Ext.Msg.confirm(
'Closing confirmation',
'YOU REALLY WANTS TO close',
function(btn) {
if (btn === 'yes')
me.hide();
}
);
},
Here is live example.
Try using the beforeclose event.