Go Back   The macosxhints Forums > OS X Help Requests > AppleScript



Reply
 
Thread Tools Rate Thread Display Modes
Old 05-29-2012, 06:02 PM   #1
brownbread
Prospect
 
Join Date: Jul 2009
Location: UK
Posts: 17
Pop Up Button - applescript : (

Hi guys

Leopard 10.5.8, intel

I'm trying to get to grips with a script that lifts information out of an Excel spreadsheet, and populates a web page entry form. Then it saves and does the same again, i.e. returns to the next line of data in Excel and carries on entering.

To explain step by step: My code is copying one Excel cell at a time and storing as a variable (always called typistSomething). Then it enters all the variables quickly, one after the other. All is well, I am just having problems with changing pop up buttons! I've paired down my code to try to work on the problem area. In the following example, you have to imagine that I've just copied a media type ("Movie") to the clipboard, then the pop up button I get to needs to be changed to "Movie" from its default blank state. I don't think I can 'set' a pop up button like I'm trying to. Please help.


Code:
set typistType to «class ktxt» of ((the clipboard as text) as record)

--enter type to Entry Form
activate application "Safari"
tell application "System Events"
	tell process "Safari"
		set pop up button "Please select the type of video file" of group 6 of UI element 1 of scroll area 1 of group 1 of UI element 1 of scroll area 1 of group 1 of window "Video Metadata" to keystroke typistType
	end tell
end tell
You see, I'm getting mixed up with 'keystroke' instruction, and just 'setting' it. The 'keystroke' instruction is because I've found that I can bypass the field targeting, and instead simply TAB to the field I want, then I can do the keystroke method... but this is not tight enough for me. It relies on the user readying the entry form, so that the tab frequency works. Sorry, not being very concise.
Any help gratefully received... I am afraid I really am a total beginner with applescript.
Thank you
brownbread is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.