This could see me lots of time if I can get it to work. My current manual effort is to copy an item from an excel spreadsheet, switch to Safari, press a button to (Create your own) which unhides a textbook, I then paste the excel item into the textbook and press the Add button - then go back to Excel to get next item over and over again.
I have some AppleScript code that captures items from an excel spread sheet and each item is passed to the Javascript code to hopefully do the click button and paste functions.
Since it is my own computer, I ty to control the environment by having just excel and just the workbook for may entries open and just one Safari tab open with the page having my buttons and input field on it.
SO far the Excel part seems to be working fine but when I tell Safari o do the Javascript it is not working.
Thank you
The current code is
I have some AppleScript code that captures items from an excel spread sheet and each item is passed to the Javascript code to hopefully do the click button and paste functions.
Since it is my own computer, I ty to control the environment by having just excel and just the workbook for may entries open and just one Safari tab open with the page having my buttons and input field on it.
SO far the Excel part seems to be working fine but when I tell Safari o do the Javascript it is not working.
Thank you
The current code is
Code:
on run
tell application "Microsoft Excel"
activate
set itemcount to value of cell "A1"
display dialog itemcount
repeat with i from 2 to itemcount + 1
activate "Microsoft Excel"
set newcell to "A" & i
set output to value of cell newcell
display dialog output
tell application "Safari" to tell document 1 to do JavaScript
"document.getElementsById('msku-custom-option-link').click();"
"document.getElementsById('msku-custom-option-input').value=output"
"document.getElementsById('msku-custom-option-add').click();"
end repeat
end tell
-- button1 msku-custom-option-link
-- text msku-custom-option-input
-- button2 msku-custom-option-add
end run