• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AS sort sprdsheet/passwords/aliases
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AS sort sprdsheet/passwords/aliases


  • Subject: Re: AS sort sprdsheet/passwords/aliases
  • From: email@hidden
  • Date: Fri, 14 Sep 2007 16:02:45 EDT

In a message dated 9/13/2007 10:56:56 A.M. Central Daylight Time, email@hidden writes:
Send AppleScript-Users mailing list submissions to
    email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
    email@hidden

You can reach the person managing the list at
    email@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of AppleScript-Users digest..."


Today's Topics:

   1. Re: rsync do shell script password.. (Simon Forster)
   2. Re: Alias Files (Emmanuel)
   3. Re: rsync do shell script password.. (Mark J. Reed)
   4. Re: rsync do shell script password.. (Wayne Melrose)
   5. Re: fileMaker Value Lists (Bruce Robertson)
   6. Re: fileMaker Value Lists (Oakley Masten)
   7. fileMaker Value Lists (Oakley Masten)
   8. Re: Alias Files (Gary (Lists))
   9. Re: fileMaker Value Lists (Gary (Lists))
  10. Re: Alias Files (Mark J. Reed)
  11. Re: Eliminating duplicate items from a list (Kevin Bradley)


----------------------------------------------------------------------

Message: 1
Date: Thu, 13 Sep 2007 10:06:03 +0100
From: Simon Forster <email@hidden>
Subject: Re: rsync do shell script password..
To: Wayne Melrose <email@hidden>
Cc: AppleScript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

A quick Google turned up:

#!/usr/bin/expect -f
# Expect script to supply root/admin password for remote ssh server
# and execute command.
# This script needs three argument to(s) connect to remote server:
# password = Password of remote UNIX server, for root user.
# ipaddr = IP Addreess of remote UNIX server, no hostname
# scriptname = Path to remote script which will execute on remote server
# For example:
#  ./sshlogin.exp password 192.168.1.11 who
# 
------------------------------------------------------------------------
# Copyright (c) 2004 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# 
------------------------------------------------------------------------
-
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# ----------------------------------------------------------------------
# set Variables
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
set timeout -1
# now connect to remote UNIX box (ipaddr) with given script to execute
spawn ssh root@$ipaddr $scriptname $arg1
match_max 100000
# Look for passwod prompt
expect "*?assword:*"
# Send password aka $password
send -- "$password\r"
# send blank line (\r) to make sure we get back to gui
send -- "\r"
expect eof

Which I'm sure can be modified to manage your rsync for you.

Simon Forster
__________________________________________________
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 20 7993 8813   Fax: +44 70 9230 5247
__________________________________________________




------------------------------

Message: 2
Date: Thu, 13 Sep 2007 11:21:16 +0200
From: Emmanuel <email@hidden>
Subject: Re: Alias Files
To: Applescript Users <email@hidden>
Message-ID: <p06230914c30eb117da9d@[10.0.1.4]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

At 4:54 PM -0500 9/12/07, Luther Fuller wrote:
>My experience is that in a list of file references, Mac 'Alias
>Files' are not resolved to their original item, but symlinks are
>automatically resolved to their original item.

That may be less true that you think. For instance, you can "read" the symlink:

read file theSymLinkPath
--> theotherfile.ext

Emmanuel


------------------------------

Message: 3
Date: Thu, 13 Sep 2007 07:12:22 -0400
From: "Mark J. Reed" <email@hidden>
Subject: Re: rsync do shell script password..
To: "Simon Forster" <email@hidden>
Cc: AppleScript Users <email@hidden>
Message-ID:
    <email@hidden>
Content-Type: text/plain; charset=UTF-8

The usual approach here would probably be to set up an SSH keypair and
install the "keychain" program (not Apple's KeyChain) to keep the key
active for non-interactive shells.  But that's a lot of setup work.

If rsync is actually using rsh instead of ssh, you could set up a
.rhosts file on the remote system to allow connections without a
password, but that's generally a really bad idea securitywise.

So yeah, I'd use expect to script the interactive interaction with rsync.


------------------------------

Message: 4
Date: Thu, 13 Sep 2007 13:19:00 +0200
From: Wayne Melrose <email@hidden>
Subject: Re: rsync do shell script password..
To: "Mark J. Reed" <email@hidden>
Cc: AppleScript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed


On 13/09/2007, at 1:12 PM, Mark J. Reed wrote:

> The usual approach here would probably be to set up an SSH keypair and
> install the "keychain" program (not Apple's KeyChain) to keep the key
> active for non-interactive shells.  But that's a lot of setup work.
>
> If rsync is actually using rsh instead of ssh, you could set up a
> .rhosts file on the remote system to allow connections without a
> password, but that's generally a really bad idea securitywise.
>
> So yeah, I'd use expect to script the interactive interaction with 
> rsync.


Funny,

Reading this was like reading everything I found with google 
searches,  that's meant as a compliment :) and it also confirms what 
I thought. :) Yeah, the idea is to try and leave the remote server 
alone, as this host script that I'm building will be distributing 
(and sync-ing) to many :)

Thanks

wayne


------------------------------

Message: 5
Date: Thu, 13 Sep 2007 05:00:43 -0700
From: Bruce Robertson <email@hidden>
Subject: Re: fileMaker Value Lists
To: Oakley Masten <email@hidden>,    Users Group
    AppleScript <email@hidden>
Message-ID: <C30E747B.71ABCżemail@hidden>
Content-Type: text/plain; charset="ISO-8859-1"

> Original Post:
>
>>> Is it possible to load a Filemaker 8.5 value list
> into
>>> a variable?
>>> The value list is created dynamically from the
> items
>>> in the current database for the field in question.
>>> The database records change from project to
> project,
>>> so I can't easily specify the list in a "hard
> wired"
>>> fashion.
>>>
>>> Such as
>>>
> {"summer","Fall","winter","spring","holiday","special"}
>>>
>>> show (every record whose cell "Caption" contains
>>> "spring")
>
> "Bruce Robertson" wrote:
>
>
>> Though applescript is useful for some things I don't
> see why it is necessary for what you are trying to do.
> This seems like just standard FileMaker scripting.
>
>
> "Gary (Lists)" Wrote
>
>
> Totally agreed, Bruce.
>
> And this may be one of the (recent spate of)
> ill-formed questions which only serve to confuse both
> asker and potential answerer alike.
>
> It's really most helpful that people say what they are
> trying to accomplish, more specifically, rather than
> just include some small bit of pseudo-code.
>
> Working with Value Lists in FM can be done with AS,
> but how that happens (i.e., the way in which those are
> established in FM) is a matter of specifics.
>
> I don't ready anything in Oakley's post that suggests
> an extra-FM need...but I think it must be a matter of
> my not really "getting" the goal.
>
> Blah. 'nuf from me.
>
> --
> Gary
>
> Oakley now writes –
> OK Gentlemen – In a attempt to ask what I thought to
> be a simple question I did not provide enough
> information.
> Please, let me try again.
>
> I have a Filemaker database that contains Items in a
> catalog listed by “SpreadName” and “ItemNumber”.
> The item list and spread names are not in order.
> There are 8 to 10 items per spread.
>
> I also have a folder of Excel files for each item with
> the name of each file being the “ItemNumber”.

1. Sorry I still cannot understand your explanation.

2. Why have ANY spreadsheets?  You've got a database.



------------------------------

Message: 6
Date: Thu, 13 Sep 2007 06:51:13 -0700 (PDT)
From: Oakley Masten <email@hidden>
Subject: Re: fileMaker Value Lists
To: Bruce Robertson <email@hidden>,    Users Group AppleScript
    <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=iso-8859-1


--- Bruce Robertson <email@hidden> wrote:

> > Original Post:
> >
> >>> Is it possible to load a Filemaker 8.5 value
> list
> > into
> >>> a variable?
> >>> The value list is created dynamically from the
> > items
> >>> in the current database for the field in
> question.
> >>> The database records change from project to
> > project,
> >>> so I can't easily specify the list in a "hard
> > wired"
> >>> fashion.
> >>>
> >>> Such as
> >>>
> >
>
{"summer","Fall","winter","spring","holiday","special"}
> >>>
> >>> show (every record whose cell "Caption" contains
> >>> "spring")
> >
> > "Bruce Robertson" wrote:
> >
> >
> >> Though applescript is useful for some things I
> don't
> > see why it is necessary for what you are trying to
> do.
> > This seems like just standard FileMaker scripting.
> >
> >
> > "Gary (Lists)" Wrote
> >
> >
> > Totally agreed, Bruce.
> >
> > And this may be one of the (recent spate of)
> > ill-formed questions which only serve to confuse
> both
> > asker and potential answerer alike.
> >
> > It's really most helpful that people say what they
> are
> > trying to accomplish, more specifically, rather
> than
> > just include some small bit of pseudo-code.
> >
> > Working with Value Lists in FM can be done with
> AS,
> > but how that happens (i.e., the way in which those
> are
> > established in FM) is a matter of specifics.
> >
> > I don't ready anything in Oakley's post that
> suggests
> > an extra-FM need...but I think it must be a matter
> of
> > my not really "getting" the goal.
> >
> > Blah. 'nuf from me.
> >
> > --
> > Gary
> >
> > Oakley now writes –
> > OK Gentlemen – In a attempt to ask what I thought
> to
> > be a simple question I did not provide enough
> > information.
> > Please, let me try again.
> >
> > I have a Filemaker database that contains Items in
> a
> > catalog listed by “SpreadName” and “ItemNumber”.
> > The item list and spread names are not in order.
> > There are 8 to 10 items per spread.
> >
> > I also have a folder of Excel files for each item
> with
> > the name of each file being the “ItemNumber”.
>
> 1. Sorry I still cannot understand your explanation.
>
> 2. Why have ANY spreadsheets?  You've got a
> database.
>
Good Morning Bruce
I have always found the AppleScript List to be of
great value in solving problems and I appreciate your
participation.  Especially since you are helping me in
solving this problem. You have helped me define and
document what I want to do and are continuing to do
so.

The spreadsheets are used by 36 different people who
only work in Excel and have absolutely no interest or
need to working any other way.
They Create these spreadsheets to drive communication
betweeen each other, our many vendors and many
suppliers.
Also, and most importantly, the Owner of the company
wants the spreadsheets - marketing uses them - the web
team uses them - the merchandising team uses them -
the catalog department uses them - the product
developement group uses them.  I am just looking for a
way to manage sorting and printing them automatically.
Therefore back to my question, which you have not
answered.
Is it possible to load a Filemaker 8.5 value list into
a variable?
And if so how?

Thanks
Oakley




------------------------------

Message: 7
Date: Thu, 13 Sep 2007 06:55:28 -0700 (PDT)
From: Oakley Masten <email@hidden>
Subject: fileMaker Value Lists
To: email@hidden,    Users Group AppleScript
    <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=iso-8859-1

Peter Baxter <email@hidden> Wrote
Subject: Re: fileMaker Value Lists

The answer is yes.  It's dead simple.  Move your
valuelist out into a 
new Layout called "Valuelist" in a field called
"Values".   Define 
your current value list to be the contents of the
field "Values" in 
which you have placed the contents of your valuelist,
and you can do 
whatever you like with the files, accessing the Layout
through AS and 
the value list from within Filemaker.  All of your
programming is 
then dead easy.  I mentioned this in the previous
email I posted on 
this issue.  Perhaps, if you can not understand what I
am trying to 
tell you, you could contact one of the Filemaker
groups about the 
process of setting this up.

On this issue you can trust me that it works.  I have
written more 
than 50 databases for schools using this technique to
allow access 
through AS to the value lists used in their databases.
They also use 
these scripts to transfer data from ACCESS databases
and the like.  I 
have also set up a system similar to yours to access
and update data 
between Filemaker data and  Excel sheets.

Why don't you give it  a try.


Oakley replys:

THANK YOU PETER :)
I did not understand your previous reply but this
makes sense and I will give it a try.

Thanks
Oakley


------------------------------

Message: 8
Date: Thu, 13 Sep 2007 10:33:44 -0400
From: "Gary (Lists)" <email@hidden>
Subject: Re: Alias Files
To: AppleScript Users List <email@hidden>
Message-ID: <C30EC288.27BD%email@hidden>
Content-Type: text/plain;    charset="US-ASCII"

"Doug McNutt" wrote:

> Even if you have Finder set to display extensions it NEVER displays a .app
> extension.

This is not true OMM.  I have ".app" everywhere.  Tiger's handling of
extension display is totally annoying. Every time I try to change an
extension, I have to do a Windows Vista "Ask-Approve" cycle.

I feel like I'm in the Mac-PC commercials.

<shrug>
--
Gary




------------------------------

Message: 9
Date: Thu, 13 Sep 2007 11:27:17 -0400
From: "Gary (Lists)" <email@hidden>
Subject: Re: fileMaker Value Lists
To: AppleScript Users List <email@hidden>
Message-ID: <C30ECF15.27C1%email@hidden>
Content-Type: text/plain;    charset="ISO-8859-1"

"Oakley Masten" wrote:

> Oakley now writes ­
> OK Gentlemen ­ In a attempt to ask what I thought to
> be a simple question I did not provide enough
> information.
> Please, let me try again.

OK, first things first.

Fix your quoting in your mail client.  This 20 characters per line thing is
not working for me.

Now, second things second.

Your question got more muddy, not more clear.

"Bruce Robertson" wrote:

> 1. Sorry I still cannot understand your explanation.

Yes, agreed.


One problem which can arise when asking questions to any mailing list is the
"too many specifics" problem. (Surely, to be balanced with the "not enough
information" problem, but that's more to do with goals rather than methods.)


In general, and until an approach is well-defined, it's best to keep things
in the abstract.

That is to say:  "How do I retrieve the list of defined values from a value
list in FileMaker?" is better than "I have 14 fields, with 72 items in a
popup menu that my boss wants sorted into departments. How do I do that?"


The second one of those is way too dependent on the specifics of your
database set-up (value lists can come from pre-defined lists, can be
aggregated from in-use values from one or more fields, or can be generated
by other means.)


So, to the question "How do I retrieve the value list of possible values for
a field?"

Well, use the 'choices' property:

tell document "untitled" to choices of field "MyPopUpOne"
  --  {"Apple", "Banana", "Cantaloupe", "Date"}
tell document "untitled" to choices of field "MyPopUpTwo"
  --  {"Ale", "Lager", "Porter"}


Now, you have a list of what the attached value list to both those fields.

It's a matter of elementary AppleScript to now loop around and get field
data for fields which have one of those list items. (Although that's still
inefficient.)

In the case shown above, I pre-defined the value list for field
"MyPopUpOne", but I let a whole other field provide the possible entries for
field "MyPopUpTwo".  That is, 'MyPopUpTwo' has possible values which come
from a third field, and the value list keeps growing as new items are
entered into that third field.

This is NOT telling me the actual VALUE(s) of any specific field at this
point. It's just telling the list of values in the value list.

Then, you can do your looping or whatever you want to get the values for any
given field:

tell document "untitled" to ...
tell current record to its cellValue of cell "MyPopUpOne"
  --  "Cantaloupe"

OR, generally equivalent:

tell document "untitled" to ...
tell current record to its field "MyPopUpOne"
  --  "Cantaloupe"


Now, because of the nature of the 'choices' property, you will be MUCH
better off taking the advice of several folks here and using FIELDS to
manage value lists rather than value lists that are pre-defined.

That is, create a value list name, but tell that VL to get its values from
some field.  Make that "some field" a field that is not really on your
layout (for the user), but rather on a special layout (I use a 'dev' layout
that has these things, and I hide it from user view, but access it via
script.)

If you do use a value list from field, then, as has been said, you can do
all your sorting and such right inside FM by using grouping and reporting
functions and you won't need to manually loop through all those records and
operate on each of them.

FileMaker does some pretty sophisticated reporting, if you use the proper
layout objects.

That is beyond the scope of this list, however, and I'd take the earlier
advice to join up with some FileMaker list or web forum or something (I hate
web forums, so I would go the list route if it were me.  The FM-Experts list
is generally pretty good, even if a little snooty and ad-heavy from time to
time.)

Anyway, maybe that 'choices' property will help you get a handle on your
needs, and then when you've worked out a general workflow with all your
departments and spreadsheets (a silly way to manage data, but okay, whatever
the boss wants, even if it's stupid, I guess) you can ask here about actual
AppleScript-related methods or problems.




------------------------------

Message: 10
Date: Thu, 13 Sep 2007 11:40:57 -0400
From: "Mark J. Reed" <email@hidden>
Subject: Re: Alias Files
To: "Gary (Lists)" <email@hidden>
Cc: AppleScript Users List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=UTF-8

I'm confused by the question.  An alias only aliases the target, not
the target's location.  I fail to see how removing the alias can have
any effect whatsover on the target.


------------------------------

Message: 11
Date: Thu, 13 Sep 2007 10:53:45 -0500
From: Kevin Bradley <email@hidden>
Subject: Re: Eliminating duplicate items from a list
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset="macintosh"

Sorry I'm a bit late getting into this conversation, but I've been 
using the code below in an iTunes script to get album names of every 
track and then strip out any that are duplicates:

set allAlbumsList to {}

tell application "iTunes"
    set albumList to album of file tracks of library playlist 1 whose 
podcast is false
    set tcount to count albumList
end tell

--remove duplicates
repeat with i from 1 to tcount
    tell my albumList's item i to if it is not in my allAlbumsList and 
it ­ "" then set end of my allAlbumsList to it
end repeat
display dialog "Processing " & (count of allAlbumsList) & " Albums" 
giving up after 5

The repeat loop is the fastest construction in Applescript I've found 
thus far for this sort of thing.  I have a moderate iTunes library of 
about 1300 songs from 125 albums, and (assuming iTunes is already 
activated, launching takes time) the display dialog pops up almost 
instantly.

Hope this helps.

Kevin Bradley
email@hidden
http://macscripter.net

On Sep 4, 2007, at 2:01 PM, email@hidden 
wrote:

> Message: 4
> Date: Tue, 4 Sep 2007 13:31:02 +1100
> From: Brett Conlon <email@hidden>
> Subject: Eliminating duplicate items from a list
> To: email@hidden
> Message-ID:
>     <OF899B4972.B88F7C8F-ONCA25734C.000C8427-CA25734C.
> email@hidden>
>    
> Content-Type: text/plain; charset="us-ascii"
>
> Hi all,
>
> In Lotus Programming I can wrap a list in an @Unique(List variable)
> command and it strips out all duplicate items. What is the simplest 
> way to
> do it in AS?
>
> I'm thinking it may have to be with a repeat and using text item
> delimiters, right?
>
> Cheers,
>
> Cojcolds

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/applescript-users/attachments/20070913/aaedd392/attachment.html

------------------------------

_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users

End of AppleScript-Users Digest, Vol 4, Issue 445
*************************************************
for file




See what's new at AOL.com and Make AOL Your Homepage.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Creating complex HTML messages in mail via AppleScript
  • Next by Date: Re: Creating complex HTML messages in mail via AppleScript
  • Previous by thread: Re: Creating complex HTML messages in mail via AppleScript
  • Next by thread: Mail Script not recognizing Account?
  • Index(es):
    • Date
    • Thread