Friday, August 29, 2014

#1 2009-11-12 05:13:52 pm

Dadoo
Member
Registered: 2008-01-30
Posts: 16

Can I populate a pop up button with a list contained in a text file?

Hi,

I am working on an AppleScript Studio project that will help our users "claim" images in Portfolio 8. In the window I'm creating in Interface Builder, the user will pick a client from a pop up button list, then enter a job number and, finally, a date. When they click OK, that information will be added to fields in every record that the user has selected in Portfolio.

I would really like the pop up button to display a list of clients that will come from a text file that will live on one of our servers. That way, any authorized user can update the list of clients (rather than me having to update the list somewhere in code every time a client is added or dropped). Then, every time the "claiming" app is run, the pop up button will display the most recent list of clients.

I've worked with AppleScript a bit, but am pretty much of an Xcode newbie. Any help will be greatly appreciated. Thanks!

Kevin Stauffer

Offline

 

#2 2009-11-13 05:19:00 am

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 10490
Website

Re: Can I populate a pop up button with a list contained in a text file?

Hi,

in this thread is described how to populate a popup button from a list. Instead of the Finder tell block you can read a text file. Assuming the text file contains the items in paragraphs, you can write

Applescript:

set a to paragraphs of (read file "theVolume:path:to:file.txt")

Last edited by StefanK (2009-11-13 05:19:43 am)


regards

Stefan

Offline

 

#3 2009-11-13 04:39:05 pm

Dadoo
Member
Registered: 2008-01-30
Posts: 16

Re: Can I populate a pop up button with a list contained in a text file?

Thanks Stefan! I haven't got the Xcode part right yet but I know that the "read file" is working based on a test I ran in Script Editor. I have a feeling that the Xcode failure is attributable to my skills (or lack thereof) in AS Studio, so I'll keep at it.

Thanks again,
Kevin

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.031 seconds, 9 queries executed ]

RSS (new topics) RSS (active topics)