Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

The tag has no usage guidance.

1
vote
0answers
22 views

AppleScript : two class with same name

I'm getting some text from Safari in a column. I used to use this script to add all text from this column in a list : PS the class is class="sortable null" tell application "Safari Technology ...
1
vote
0answers
12 views

Use jQuery in Fluid.app's Userscripts?

In Fluid.app's Userscripts section, you can write custom Javascript to modify the embedded site. Cool! My Fluid app's embedded site has the jQuery library loaded. I'd like to reference and use that ...
0
votes
0answers
23 views

AppleScript get text from safari (unknown index)

How get I get the value of the class "value" in the following e.g <div class="related-info-ind component" id="fsdfdsf-sdfsdf-sdfsfgge-wegdsf-gdssdgf" data-ok="0" data-neut="0" data-detected="0" ...
0
votes
0answers
18 views

Applescript Getting all occurence of ClassName

I need to get all the text (numbers) which have the same classname and add them to a list. Here is the html tag <td class="sortable PersonID"> 1545486 ...
0
votes
1answer
36 views

AppleScript / Javascript : remove columns in Safari

Is there a way to remove all instance of a class in safari using AppleScript/Javascript ? For e.g I would like to remove each instance of : `<td class="sortable cardTypeDisplayName"> ...
0
votes
0answers
36 views

Keynote Automation using Applescript/Java

I'm looking to create an AppleScript to automate my Keynote workflow. Basically, I want to replace a marker in the Presenter Notes with text from a table (Numbers, Excel, or other). I found this ...
0
votes
1answer
40 views

Applescript / Javascript : select menu

I'm filling a webpage using Applescript / Javascript, one of them is a dropdown menu, which I fill with this code : document.querySelector('select#reasonPopUpButton').value = '18'; the issue is ...
0
votes
0answers
302 views

How to whitelist websites to autoplay videos on Safari on iOS (11.2.1)

I am creating a game that uses <video> tags that needs to autoplay videos. The logic of the game goes as follows: On page load, a video (with audio) autoplays, ranging from 3 seconds to 30 ...
1
vote
0answers
34 views

AppleScript grab value from safari with repeat / add in list

I need to grab data from a safari, There is a random number of : document.getElementsByClassName('sortable DataSummary')[1] this work fine : tell application "Safari" set mzRawData to do ...
0
votes
1answer
62 views

AppleScript click on Safari <th> link

Based on this HTML tag, how can I click on View from TrustedMachines? I know how to do it from document.getElementById or name but not sure how to do it this cases <td> <a data-auto-...
2
votes
0answers
51 views

highlighting text in safari

I need to highlight every instance of some keywords in Safari. I have this script which work : set myList to {"demo", "demo1"} try tell application "Safari" do JavaScript "document....
1
vote
0answers
18 views

Bulk editing work/movement on Windows

I am trying to bulk edit a bunch of iTunes metadata based on the work and movement on Windows. Back when I had a Mac, this was possible with AppleScript; however, I don't think the JavaScript API has ...
1
vote
2answers
117 views

document.querySelector with AppleScript / Safari

I need a script to open each tab in safari when I get "valueIneed" from an internal website here is the HTML tag <td class="orderDetails"> <p class="details"> (My ...
3
votes
1answer
191 views

In AppleScript or JavaScript how can you click menu item?

I need to change a theme using a script for Mojave, Alfred and Sourcetree. I've already successfully done this with Mojave and Alfred using this script: var alfredLightTheme = "Alfred" var ...
2
votes
1answer
143 views

Applescript/Javascript to click submenu item of Jupiter Notebook in Safari

When I run a.ipynb jupyter notebook file in Safari, it opens at local host http://localhost:8888/notebooks/a.ipynb#. NOTE: The script should work for any *.ipynb file, a.ipynb is just an example. ...
0
votes
1answer
63 views

How to save a bookmarklet link when using safari?

How can I save the link of a bookmarklet in iPad’s safari? For example any of the bookmarklets in the following website? When I touch and hold, an option to save the link is not offered. http://...
1
vote
0answers
263 views

iPhone: Safari doesn't work well with JavaScript turned off

Why does my iPhone require JavaScript to be turned on for Safari to work well, while my other iPhone does not require the same? I have the following two iPhones, both running iOS 11.4.1 (current as ...
1
vote
0answers
306 views

Using Applescript to execute Javascript in Chrome and set a value to a variable

I'm building a service through Automator. So I'm trying to execute this bit of Javascript in Chrome and set the clipboard to the value of one of the variables. Essentially it is grabbing the contents ...
0
votes
0answers
38 views

Think my Dad may have just downloaded the Apple Security Malware

My dad doesn't use a Virus checker (doesnt disable Java either and isn't running the latest OSX) and just appears to have fallen for the Apple Security malware popup (looked and sounded something like ...
4
votes
1answer
273 views

Is there a manual for JavaScriptCore shell (jsc)?

MacOS ships with a JavaScript shell jsc in the JavaScriptCore framework. The easy way to run it from Terminal is to link it into a standard directory: ln -s /System/Library/Frameworks/JavaScriptCore....
1
vote
1answer
344 views

Why can a command in Safari's Javascript (JS) console not call a previously defined function?

I have the latest MacOS and Safari on a 2012 Macbook Pro. https://stackoverflow.com/questions/50513038/how-to-automate-download-of-generated-pdfs/50515826#50515826 provides me with a function and a ...
2
votes
1answer
281 views

Applescript to highlight text in Chrome using Javascript

I can't figure out how to adapt this script, which highlights text in Safari, to get it to work with Google Chrome: set myList to {"AppleScript", "2018", "demo@apple.com"} tell application "...
1
vote
0answers
80 views

Applescript and javascript document.querySelectorAll click on a link

I'm trying to click on the ViewMYMachines link, I'm not sure how to proceed, I suppose I have to use document.querySelectorAll here is the link : <a data-auto-test-id="ViewMYMachines" href="/...
2
votes
2answers
141 views

AppleScript & Javascript change text colour on safari

I'm not sure if this is possible but let's say I have a few variables : var1 "text1' var2 "2018" var3 "demo@apple.com" Can I make Applescript to found every instance of this text on Safari (any tab) ...
0
votes
1answer
332 views

Apple Script, Javascript: fill text filed (web form) with data from clipboard

I want to fill a webform (text filed) from a page i open in Safari with the text from a excel cell. I have managed to do a script to copy the cell content to clipboard but i do not know how to use ...
0
votes
1answer
79 views

Applescript javascript multiple line

How can we add multiple line text in Chrome using document.getElementsByClassName? I have no issue when it's one line but one I have more than one I have a missing value instead set myCaseNote to "...
1
vote
1answer
383 views

JavaScript run by AppleScript to click button and fill text in Safari

I’m not managing to execute JavaScript in Safari anymore. I have this working script for Chrome. set caseID to "11111" end tell ####################################### time ######### set myDate to ...
0
votes
1answer
163 views

Applescript remove Missing value and unwanted data

I created a script to return some credit card informations from an internal website <a href=\"/web/Support.aa/aa/g55erefesfsfsf/4.g.g.5.24.54\"> ...
3
votes
1answer
116 views

Applescript & Javascript to get number from chrome and give a total

I'm trying do get every totals from an internal webpage and get the total. for getting a single result I wrote this : tell application "Google Chrome" tell tab 1 of window 1 to set orderTotal to ...
0
votes
1answer
947 views

Applescript to run javascript on chrome

Is there a way to run an Javascript using AppleScript here is the JS : javascript:Array.from(document.getElementsByClassName('action-button')).forEach(function(v){v.removeAttribute("disabled");}); ...
1
vote
2answers
472 views

AppleScript click on button (chrome)

Here is the HTML tag of the button I would like to click using AppleScript. <button class="btn btn-primary" autofocus="" ng-click="ok()" tabindex="0"><!-- ngIf: !isTranslate --><span ...
1
vote
1answer
751 views

Applescript click on a button

Is this possible to click on the button "detailed" using AppleScript (Google chrome) for="7cd6f428-1are-41f2-9054-c452d7fe242-view-selector-e5f5de50-634a-45bc-bf30-98e2a64676cc">Detailed I would ...
0
votes
2answers
498 views

How to change safari search engine Mac OS

I want to change safari default search engine by native app or safari extension however it's possible. I have tried to change preference (com.apple.safari.plist) file but there is no key to related ...
3
votes
2answers
277 views

How to write an AppleScript that downloads Wi-Fi network status from router's web interface?

Objectives: I want to create an AppleScript .scpt file that does the following: Accesses a router's webpage (i.e., its IP address). From this webpage, gets the IP addresses that are currently ...
1
vote
2answers
612 views

AppleScript JavaScript getElements

I have my script partially working. I'm using AppleScript to script interactions with Chrome. set textToSave to "Text" tell application "Google Chrome" execute front window's tab 1 javascript "...
2
votes
4answers
2k views

AppleScript alternatives

I've recently discovered AppleScript. AppleScript affords a simple, natural way to programmatically simulate keyboard-and-mouse interaction with Mac applications. AppleScript is great, however it ...
3
votes
1answer
100 views

How can I find a specific JavaScript identifier of a website?

I want to use JavaScript to set the scroll amount of a webpage in an AppleScript, using the second method described in this answer. This answer focuses on one webpage in particular. I want to branch ...
2
votes
1answer
61 views

Single Key Macro for OS X

I want to make a simple macro for a game I play but can't figure out how through mac programs. I'm looking to run a macro where when I press x, it outputs as pressing the x key twice in a row very ...
2
votes
0answers
657 views

Applescript / Javascript : click button with getElementsByClass

Here is the button I would like AppleScript to click : <button class="btn btn-primary" autofocus="" ng-click="ok()" tabindex="0">OK</button> Here is my code : tell application "Google ...
3
votes
1answer
1k views

AppleScript to find a tab by its name in Google Chrome

I'v forgotten how to find a tab by its name and return the value (e.g tab 2) and eventually set the tab as the active tab too. I've tried the following, but it's not working: set titleString to " " ...
5
votes
2answers
592 views

Output JXA to stdout

I have a small script made with JXA (JavaScript for Automation) that outputs a result to the shell with console.log. However, console.log seems to output to stderr and I’d like to output to stdout. I ...
2
votes
1answer
551 views

applescript getElementsByName in Chrome

I need to fill up a text field and click on a button on Google Chrome Here is my script for safari. tell application "Safari" ## tell window 1 of application "Safari" to set current tab to tab 1 -- ...
1
vote
0answers
257 views

Testem returning “command not found” in terminal

I am attempting to call testem on a directory in my terminal. It was working for a while, but now every time I call testem it returns the message "-bash: testem: command not found" I must have done ...
1
vote
1answer
562 views

Automator: replace text input not working

What I want to do I want to create a simple Automator service that: Takes text as input from any application, Does some logic on given input Replaces the selected input text with the calculated ...
1
vote
1answer
737 views

AppleScript detect key press by user alternatives

I have searched and found that AppleScript is unable to detect key presses by the user. I would like to know is there any other alternatives to do this? I am building a script for a specific tabs in ...
1
vote
1answer
556 views

python script to create a desktop icon

Right now I'am using npm start to open a desktop app (i.e nodejs server) which uses electron framework. So when ever I want to open that desktop app I have to open the terminal, go the application ...
0
votes
1answer
632 views

Safari: get URLs of images displayed in Web Inspector

How do I get the list of the resources loaded in Safari's Web Inspector? (Web Inspector > Resources > Images) My goal is to download all images shown in the inspector. These are the manual steps: ...
1
vote
1answer
72 views

Open Favourites Page in Safari with Javascript

I'm trying to make an extremely simple Safari extension that open the favourites page (the equivalent of Bookmarks > Show favourites), as that's what I think of as my home page and I'd like a button ...
2
votes
3answers
11k views

iOS 10 Safari JavaScript setting disabled

Today, JavaScript in Safari suddenly stopped functioning. I had just updated my iPhone 6s to iOS 10 yesterday. I eventually noticed that somehow, JavaScript had been disabled in the Safari settings. ...
1
vote
2answers
887 views

Apple Javascript (Script Editor) Documentation

Is there a tutorial on how to use the documentation for Script Editor and Javascript? I've been using AppleScript and Automator (with JavaScript) for a while but not extensively. I love how it works ...