Acrobat's Javascript console is not working - javascript

Moving from InDesign to Acrobat now, I need to automate a very simple task. I'll eventually use BridgeTalk to have an InDesign script call Acrobat X and have it do a couple of simple things. To this end I've been reading up on how to script Acrobat. Unfortunately, it does not seem anywhere as simple as scripting InDesign or Illustrator.
For one thing, the ExtendScript Toolkit is now useless since Acrobat has a built-in "Javascript Console". This would be perfectly fine, except that my console seems to be completely broken. Once I launched it (and it was hellacious just trying to figure that out), I type in a simple 3 + 4 in the console and press Command+Enter, as noted in Thom Parker's guide on AcrobatUsers. (I don't have a fancy Mac extended keyboard with a numeric keypad, so I have to use Command+Enter.)
Nothing happens.
I've tried other things, such as selecting the code first, pressing Control+Enter instead, using a different line of code such as console.println("Hello.");, etc. Nothing I do seems to work. What am I doing wrong?

Finally got my question answered over on Adobe's forums. I thought I had tried everything, but it turns out that I had not even tried a simple Shift + Enter. Hard to believe, since I thought I'd tried every possible key combination already, but I cannot deny the facts. Since I only had the small Apple keyboard without the numeric keypad, I suppose this is the only way to get Enter instead of Return from that key. At any rate, the answer is now known!

It seems to be command-return on MacOS 10.13.6 But thanks for the hint above.

Related

Visual Studio missing most Javascript editing functions in one solution

I have a bizarre issue where a websites JavaScript files are missing many of the editor functions such as:
handles around code blocks; buttons that allow collapse/expansion
correct line breaks; when pressing enter the cursor goes to the next line but first character position rather than nested per previous line
Keyboard shortcuts missing
Intellisense missing
The dotted line showing the start/end of a nest
and various others.
What I did to get to this:
I have a website in a solution, call it solution A and the JavaScript editing is normal.
This website is going to be moved into a new solution along with other projects.
I created a new empty solution (solution B) and added some solution folders.
I copied the website (via windows exploroer) from solution A to solution B.
Modified the namespace within the csproj file using notepad
Added this website as an existing project to solution B
Performed a find/replace through the code to adjust the namespace to the new one set in D above.
Now when I open my JavaScript files I get none of the functionality listed above.
I have verified that the Text Editor / Javascript/Typescript options are good.
The 2 images below are from copies of the same file in different solutions both running on Visual Studio 2017. The images demonstrate the lack of the collapse/expand button and the dotted lines. Interestingly, all color is correct.
Any ideas what might cause this?
Good JavaScript
Bad JavaScript
After some digging around a colleague found this link talking about a very similar issue - JavaScript intellisense still not working
One of the comments mentioned disabling the 'Language Service' function.
I did this, and sure enough all functionality has returned.
I am not going to mark this as an answer because i've had to disable one thing to cure another. This is just what i have had to do to get JS to edit correctly.
What I am doing right now us updating Visual Studio. It's currently 15.0.26430.4 and 15.4.27004.2002 has just been released. With any luck this resolves the issue.
UPDATE
After updating Visual Studio all is working correctly. Can only assume there was an issue with the Language Service.

a script with two different behavior on the same version of chrome

I'm not familiar with javascript but my boss would like me to solve something weird so I took some time to investigate, with no satisfaying answer so far. Problem is, we have a script (jQuery) which works perfectly on most of our computers except for two of them, on chrome exclusively. All with the exact same version of the browser (55.0.2883.87 m). The script is a slider (Flipster) with 4 slides, with 3 hidden on the faulty machines instead of 4 with one bigger on focus when everything goes according to plan. Anyway, you obviously won't be able to find the answer for me (and I don't ask for it) but what I may ask you is where I might start digging, if some of you ever faced such situation and found their way through this in some particular areas...
Thank you for your attention!

How to write a twitter-like RichText box for mentioning entities?

After weeks of trying and testing to find a solution for my needs I admit that I still have no idea how I can solve this problem.
It sounds simple: I want that a user is able to mention things in a text area similar to twitter.
The problem is that I can't seem to manage it to make it work. Every browser has its own specialties which are coming into my way and break things. I have tried multiple different attempts but none of them worked even on a single browser completely.. mixing text and HTML appears to be incredibly hard to do.
So here I am. Asking you guys for any kind of help. Whether it's a library you can recommend me that is already doing what I need here, or if you did something similar and can tell me what exactly you did to make this work on multiply browsers.
My current solution looks something like this: Hitting # will insert a input text field into a div contenteditable everything is working nice so far unless the whole thing is the first element of a row. If the caret is also at position 0 and the user hits Enter, then something dies inside the browser which removes the whole input box without further notice or any events - at least not on Chrome. That was the most promising solution that I was able to come up with. Don't think I didn't try to save it by inserting e.g. a native Text with a zero-whitespace-character but that doesn't work either. It works better - but not completely.
I'm really frustrated by now and this is holding my whole project back which has this key feature that has to work properly - mainly because the information put there is going to be persisted as XML but that is a completely different story.
I really hope somebody can help me to get a solution for this. Bear in mind that I am actually using GWT 2.8.0 but I would not mind to use/wrap a JavaScript library at this point ..

How can I edit JavaScript from Microsoft Edge?

How can edit the source code of a website in order to modify its method? This is for a CTF challenge which involves exploiting the website but I cannot modify it in Microsoft Edge. I was able to do it on Chrome on another computer and tried it on mine, but it did not work either. What's the problem here?
EDIT: The problem that I have is that Edge won't allow me to modify the code. I try to double click on it but when I try to type something, nothing happens. In my case, I need to remove a few lines of code to change the outcome when it works in order to get the flag but it won't allow me to. I also have checked my settings to allow experiments on the JavaScript and restarted my browser but it didn't work.
you need to go to tab Experiments in DevTools and turn on appropriate option
article

Javascript optimization - Is there an easier way to speed up Javascript?

I wrote a hefty script in JS and I want to optimize it to run faster, but going through function by function and performing a "speed test" is taking too long. Anyone know of a better way? I've heard you can use firebug, but I haven't found any helpful links of how to go about that..
The page I'm optimizing is here:
http://flanvas.com/development/flanvas/examples/custom-class.html
I'm specifically trying to optimize the flanvas.js which is here:
http://flanvas.com/development/flanvas/flanvas.js
Any direction of where to go from is very helpful. Thanks!
Use FireBug, or the Developer Tools in Safari or Chrome. In Safari/Chrome, go to the "Profiles" tab, click the "Enable Profiling" button, and hit the 'record' button. After you've done enough testing, hit it again to capture the profile.
You'll get a wonderful list breaking down your functions by the time they took, the time other functions that they called took, and multiple ways to sort it.
Rather than walk you through this, I'll give you some of the Google searches you should have done before asking this question:
http://www.google.com/search?q=profiling+javascript+firebug
http://www.google.com/search?q=profiling+javascript+chrome
You want to do profiling first for your javascript code to find which part of the code is the slowest. Of course, the main tool for that is firebug. Firebug is a very great tool for profiling.
You may also want to see this question for some more help:
What is the best way to profile javascript execution?
If you are using Firefox, firebug is a good tool, it can also give you some basic ideas on how to speed up javascript.
More at http://getfirebug.com/whatisfirebug
You can download it as JS code, and add it to your file if you are using other browser.
Still, there are other tools around, if that doesn't help... but it is a good start

Categories