Applescript retreive text from dropdown menu safari
Hi everybody
I need to get the text of dropdown menu in Safari
Eventually loop to each option to get every item (text)
But for now i just try to get one... Applescript allways return message (missing value)
tell application "Safari"
activate
tell document 1
do JavaScript "var mySelect = document.getElementsByName('customer')[0].selectedIndex.text()"
end tell
end tell
I'v try document.getElementsByTagName...same result
Thanks
OK i'v found
i get the number of option by
do JavaScript "var v = document.getElementsByName('customer')[0].length;"
then i loop putting the v variable at the end of the selectIndex
do JavaScript "var x=document.getElementsByName('customer')[0].selectedIndex=" & v & ""
in addition with the option
do JavaScript "var y=document.getElementsByName('customer')[0].options;"
and concatenate all
do JavaScript "var full=y[x].text;"
voila !!!
Similar Messages
-
How to change multiple commands label text from default "Menu" to "Go to"
I m new in J2me and J2me polish and having problems in label of command.
Here I code that add multiple commands
Command chPinCom = new Command("Change Pin", Command.SCREEN, 2);
Command accCom = new Command("Account", Command.SCREEN, 2);
Command favCom = new Command("Favourites", Command.SCREEN, 2);
the code that add commands in list
listScr.addCommand(chPinCom);
listScr.addCommand(accCom);
listScr.addCommand(favNumCom);
listScr is the type of LIst
Please help that hoe I change commands label text from default "Menu" to "Go to" that showed in right bottom on the screenIt's possible see book "Pro J2ME Polish Open Source Wireless Java Tools Suite" on page 90 ....see Localizing the J2ME Polish GUI
I just change my build.xml file and add one more variable like
<variable name="polish.command.options" value="Go To"/>
and it's working fine.. -
Applescript get text from mail message
Hi,
I've got a nested script that ideally would work with a multiple selection of emails. Most of the script does but I've recently found the need to add the sender's delivery address to the outgoing message. I've found a way to insert the clipboard but that leaves me only being able to send out one message at a time and I have to copy the address for each message to the clipboard first. I made a script to do that bit once I'd selected the text but this only works from Applescript Editor and not Quicksilver which is what I normally use.
So, what I'm hoping is someone would be able to help me with the a, select the right bit of text between Delivery address: and Instructions to merchant: of each message and have that work with Quicksilver and b, tell me why the following script only partially works from Quicksilver, i.e. the top bit, copy to clipboard, doesn't work.
Thanks.
tell application "System Events"
tell application "Mail" to activate
key code 8 using command down
end tell
tell application "Mail"
set thesenders to {}
set thesenderstext to ""
set myaddress to the clipboard
set theMessages to the selection
repeat with eachMessage in the theMessages
repeat with i from 1 to the number of items in eachMessage
set theAccount to "[email protected]"
set theSender to (extract address from (the reply to of (item i of eachMessage)))
if thesenders does not contain theSender then
set thesenders to {theSender}
end if
set replyName to (extract name from (the sender of (item i of eachMessage)))
set titleCaseString to (do shell script "/bin/echo" & space & quoted form of replyName & space & "| /usr/bin/perl -p -e 's/(\\w+)/\\u\\L$1/g;'") as Unicode text
set firstName to word 1 of titleCaseString
end repeat
set AppleScript's text item delimiters to ", "
set thesenderstext to thesenders as rich text
set AppleScript's text item delimiters to ""
set newMessage to make new outgoing message
set theSubject to "instructions"
set theContent to "Dear " & firstName & ",
Thanks so much for your order.
You will receive a despatch notice by email when your order is sent.
Your Order is being sent to:
" & myaddress & "
Kind Regards
Jim
set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
set theAttachment1 to POSIX file "/Users/Jim/qrcode.13177607.png"
set theAttachment2 to POSIX file "/Users/Jim/qrcode.13177658.png"
set theAttachment3 to POSIX file "/Users/Jim/qrcode.13177665.png"
tell newMessage
set visible to true
make new to recipient with properties {address:thesenderstext}
--make new bcc recipient at end with properties {address:theBccRecipient}
make new attachment with properties {file name:theAttachment1} at after the last paragraph
make new attachment with properties {file name:theAttachment2} at after the last paragraph
make new attachment with properties {file name:theAttachment3} at after the last paragraph
-- send
end tell
tell application "Mail"
set a to selection
repeat with s in a
set flag index of s to -1 as integer
end repeat
set theSelection to the selection
repeat with theMessage in the theSelection
move theMessage to mailbox "orders" -- of account theAccount
activate
end repeat
end tell
end repeat
set read status of every message of mailbox "orders" to true
end tellShoot! I wrote this huge reply and then quit Safari by accident. I'm too tired to type it all over again (I should install a keylogger).
Anyway, check out the screen shot of my workflow. the AppleScript section is where it xfers the URL from a text editor (BBEdit) to Safari. It's pretty dirty but it works.
http://www.jameskocsis.com/urlworkflow.jpg
post antother reply if you need more data on this process.
Good luck.
-James -
How to copy and paste text from web in safari
would like to copy and paste selected text from websites while in safari to my ipages.
Quickly double tap on the screen that you want to copy. When you see the blue area pop up drag the edges of the blue block to the portion you want to copy. Tap copy.
Next open something like "Notes".
Open new document.
Double tap and a "paste" option will pop up.
Click paste and your selection will appear.
You can then edit, save, etc. -
Mac Pro will not restart from dropdown menu
Hi all,
My Mac Pro will not restart from the dropdown menu or when clicking the 'restart computer' when installing software updates. I have an external firewire hard drive hooked up as part of my backup process. It contains a clone of my startup disk.
I have tried disconnecting the firewire drive, rebooting then attempting to restart from the dropdown menu. Still no joy. I always have to end up shutting down manually by holding the power button in and then restarting with the power button.
Any thoughts?
Thanks in advance.
DennisYou might try Safe Mode (It will take more time to startup in Safe Mode because it runs a directory check.)
If your Shutdown functions correctly that way, go to System Preferences >> Accounts >> Login Items, and remove them. Boot normally and test. If not go to ~(yourHome)/Library/Contextual Menu Items and move whatever is there to the desktop. Then do the same with /Library/Contextual Menu Items. Lastly, try moving ~(yourHome)/Library/Fonts to your desktop and restarting.
Log out/in or restart, if that sorts it start putting items back one at a time until you find the culprit.
EDIT: Also, if you can launch Activity Monitor in your Utilities folder and see if you can find the process that is still running.
-mj
Message was edited by: macjack -
Text from bookmarks menu appears on desktop
Just installed FF4 yesterday and since doing so, have found that text from my Bookmarks menu is appearing on my desktop below my browser window. This is happening even when I haven't actually used my Bookmarks drop-down.
I tried minimizing the browser but this didn't help. The text disappeared only when I either closed the browser completely, or when I dragged the open browser window from side to side on the desktop.Do you have that problem when running in the Firefox SafeMode?<br/> ''A troubleshooting mode.''<br />
1.You can open the Firefox 4.0 SafeMode by holidng the '''Shft''' key when you use the Firefox desktop or Start menu shortcut. <br />
2. Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut to open it again.''
If not, see this: <br />
http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes -
Dynamic Results from Dropdown Menu PLEASE HELP!!!
Hi. Here's an example of what I'm trying to accomplish. (the Order Estimator section) http://www.modernpostcard.com/products_services/pricing/ Are there any good resources, tutorials, etc. anyone could point me towards on this entire process? I'm just starting out so I'm not really sure what I need to search for.
Hi Marc
Option for quantity wouldn't be any problem. ^^
Okey here you go, first make a "Dropdown-Menue"
Add the options you wanna give with the green button.
Then go to bind/binding; click the checkbox there.
Now get a decimal field in your form. (Name probably "Decimalfield1")
Click the dropdownlist. There should be some kind of table where you can enter a script. First choose "Exit" and "JavaScript".
Then you should write in there something like
if (this.rawValue == "1")
{decimalfield1.rawValue = "3,00"}
if (this.rawValue == "2")
{decimalfield1.rawValue = "4,00"}
Be sure to use the right names ;D
Do that with all your boxes.
The last box with the sum:
Get in there, choose "Calculate" (FORMCALC)
Write in decimalfield1 + decimalfield2 + (and so on)
To make the dollar sign and so show up you've got to give a pattern in each field :)
Hope that helped :)
Lisa -
Can old text messages be retreived from your SD card?
Only if you specifically saved them to the card, and that option is not available for most phones.
-
Some sample Applescripts are missing from Script menu.
I am a new to AppleScript and I have just started reading A Beginner's Guide to Apple Script (by Guy Hart-Davis). The book makes numerous references to the default example scripts that are created during OS X install. I have added the script menu to to the menu bar and when I open the script menu - I only see about half of the default scripts that are shown in the book. I did some browsing and found other examples of the script menu which shows fewer scripts than the example in the book - but still shows a few more than what I am seeing on my system. On my system I do not see the following scripts (Address Book Scripts, Basics, Finder Scripts, Info Scripts, Internet Services, Navigation Scripts, URL's or Virtual PC Scripts). I am on SL 10.6.2. The book is written for SL 10.6 - but also makes references to Leopard 10.5. Is there something wrong with my system or were some of these default scripts eliminated in 10.6.2. My iMac came with 10.6.1 initially - so I have no prior OS version as a point of reference. My concern is that I progress with the lessons and exercises in the book - that there will be continued references to these missing scripts - as I suspect that the missing scripts may be used as a starting point for creating new scripts. Any idea where I can find the scripts that I listed as missing?
Thanks. The book I am using appears to be a brand new book just released a month ago (or so). It appears the book may have been written for Leopard and tweaked for Snow Leopard (but under the guise of being the other way around) - without actually verifying that the examples for Snow Leopard actually work. The website for the book (McGraw Hill) does not seem to provide a mechanism for providing feedback or errata info. So far these missing scripts have not hampered my progress - except on the initial example. I was more concerned that something was missing from my iMac.
-
Bookmarks will not load from dropdown menu
Hi,
i copied a lot of bookmarks over from safari to add to my existing bookmarks in firefox. The import seemed to work fine at first but soon i found that the drop down menus for my bookmarks toolbar would not load. Sometimes some and not all will load, sometimes not at all. If I open a sidebar, I can see that all my bookmarks still exist. Some have picture icons next to them, some have a blank white page icon. The ones with the blank page icons don't load from the sidebar.
I'm not the most technical and it took me hours to arrange my bookmarks. Any fix for this without having to start from scratch would be really helpful.
thanks!
Henry.You might try Safe Mode (It will take more time to startup in Safe Mode because it runs a directory check.)
If your Shutdown functions correctly that way, go to System Preferences >> Accounts >> Login Items, and remove them. Boot normally and test. If not go to ~(yourHome)/Library/Contextual Menu Items and move whatever is there to the desktop. Then do the same with /Library/Contextual Menu Items. Lastly, try moving ~(yourHome)/Library/Fonts to your desktop and restarting.
Log out/in or restart, if that sorts it start putting items back one at a time until you find the culprit.
EDIT: Also, if you can launch Activity Monitor in your Utilities folder and see if you can find the process that is still running.
-mj
Message was edited by: macjack -
Unable to copy text from PDF in Safari
Where did the Copy command ability go when viewing a PDF in Safari? In a recent Safari update, the functionality has disaapeared. Prefer not to take the extra step to Save As, then open in Preview or Adobe Reader just to copy a word or line of text. Suggestions please.
Disregard question, found it. Right click, or Ctrl+click to use submenu to Copy.
-
Selecting file from dropdown menu
Hi,
I've just converted a form from Excell into PDF. My original form had an option to open another page by selecting a file from a dropwdown, then hitting a button.
Obviously the macro will not work in PDF, but is there another way in which I can open a specific file from a dropdown list. At the moment I am only able to open one file per button. I need to be able to scroll down, say A, B, C, D, E and then select which number I want to open.
Any help is much appreciated.You can start here: http://www.adobe.com/devnet/acrobat/javascript.html
But I should warn you, it's very different from VB, and it could be complex.
Good luck, though. -
How do I highlight a text from Word or Safari?/ dragging items.
I have a Macbook Pro, bought in 2009. Normally, I would be able to use the track pad to highlight, copy and paste an item, but I have not been able to highlight anything with the trackpad. I am still able to double tap a phrase, highlight a selected phrase, and then copy and paste the phrase. I also just found out that I am able to double tap where the courser is located, double tap, and select a phrase I want to copy and paste, but I would still like to use the Track pad.
In addition, I have not been able to drag and drop items to different folders, along with having two separate windows open and dragging and dropping items. I have recently enabled the "Dragging" and "Drag lock" options, but can only drag and drop items, not folders.
How would I fix this problem or would I have to take it into the Apple Store? I would like to avoid the latter, but it might be inevitable. Thank you!With 2 hands? Could you elaborate on this?
If you would like to explore some more advanced custom gestures I would suggest downloading BetterTouchTool which is a powerful tool that will enable you to fully customize your trackpad. -
Problem while retreiving data from a text file
AOA
I tried to retreive text from a .txt file.
By using following code, i get junk box after every character retreived. What may be the reason.
public void run()
try
FileReader reader = new FileReader(uidsFile);
BufferedReader bin = new BufferedReader(reader);
while((line = bin.readLine()) != null )
String uid =line;// line.substring(0,4);
System.out.println(uid.trim());
catch(Exception x)
JOptionPane.showMessageDialog(null ,
x.getStackTrace(),
JOptionPane.INFORMATION_MESSAGE);
}The reason would be that that is what your text file looks like (namely UTF-16) while you use a FileReader without specifying any encoding, which means that it will choose your platform default - which is not UTF-16.
-
Hello
I want to just write a simple Labview program that would take an input from user (The input must be limited e.g creating a drop down menu). Then based on this input, it must ask user to enter other inputs. for example.
Input 1. can be either a colour , a month or a fruit.
Input 2. If input 1 is colour, then drop down menu should take Red, Green, Orange and Yellow from user. If Input 1 is month, it should ask for one of twelve months and so on.
In the third step I am going to use both of the inputs.
Take the example from snapshot.
I would like if you could indicate me an easy method to use this, or should I create a text / excel file or some sort of table to implement this.
Thanks
Thats fine but I want that. If user selects Month from dropdown menu 1, The second dropdown menu should automatically show just the names of months.
If user selects Colours from dropdown menu 1 , the second dropdown menu should only show colour names.
I hope you understand my problem.
Maybe you are looking for
-
Exception while invoking web service
Hi all, I am trying to consume a web service which is actually a BAPI which is being exposed as a WS. The BAPI is BAPI_COMPANYCODE_GETLIST. The following is the code that I use to execute the Web service: /***************************Code Begin
-
How to refresh the content of an external file
Hi guys. I need to use an external file, no matter the extension(txt .xls .xml .mdb .csv) in the oracle BI rpd. I Use this file like a center table in my star schema and this file need to refresh frequently. How i can see, dynamically, the changes in
-
No sound is coming from my HP pavilion dv5 laptop after automatic update
product name: HP pavilion dv5 laptop operating system: windows vista 32 bit home primium after automatic update no sound is coming from my laptop.internal speaker are also not working.also windows starting sound is not coming.i also installed the dr
-
Hello, I'm on Java and I put a xml in a dom. Now I need to check that all "mytag" as a ddiferent "id" value: <xml........................> <mttag id="one"............./> <mttag id="two"............./> <mttag id="one"............./> //--error
-
Adobe Reader: can't open documents
I have a MAC OS X version 10.8.5. I've downloaded the latest version of Adobe Reader but cannot open any documents. I tried Apple support but the tech, after following his protocol, could not fix the problem. What to do?