Re: newbie tries to define variables
Re: newbie tries to define variables
- Subject: Re: newbie tries to define variables
- From: Rick Norman <email@hidden>
- Date: Wed, 02 Oct 2002 11:24:40 -0500
This definitely helped to clear things up, after this it was just a matter
of resetting AS old_delimiters back at the correct time in the script.
Needless to say this corrects the problem that I was encountering and I want
to thank those who were willing to help. Now, of course another part of the
whole script is not working, so I'm dealing with that now.
Thanks again,
Rick Norman
>
From: John Swartz <email@hidden>
>
Date: Wed, 2 Oct 2002 11:10:38 -0400
>
To: Rick Norman <email@hidden>
>
Subject: Re: newbie tries to define variables
>
>
If I understand what you're trying to do, your repeat loop isn't big
>
enough. The variables get assigned and then stay that way except for
>
a_folder.
>
>
Maybe try it this way:
>
>
> on open theFolder
>
> set old_delimiters to AppleScript's text item delimiters
>
> set AppleScript's text item delimiters to ":"
>
> repeat with a_folder in theFolder
>
> set n_items to the number of text items in (a_Folder as string)
>
> set theName to text item (n_items - 1) in (a_Folder as string)
>
> set AppleScript's text item delimiters to old_delimiters
>
> set recNum to text 1 thru 2 of theName as integer
>
>
>
> display dialog "theName" & "-" & theName
>
> display dialog "recNum" & "-" & recNum
>
> display dialog "theFolder" & "-" & theFolder
>
> display dialog "a_folder" & "-" & a_folder
>
> end repeat
>
> end open
>
>
That's kind of a rough version to give you the idea of what I mean, I
>
haven't tested it or anything...
>
>
Good Luck.
>
>
JS
>
>
>
On Wednesday, October 2, 2002, at 10:51 AM, Rick Norman wrote:
>
>
> What I'm trying to achieve with the following is to be able to drop
>
> multiple
>
> folders onto an applet and have each one processed using parts of the
>
> name
>
> of the folder. The folders are named in this manner
>
> "02personsnameaddress",
>
> "03personsnameaddress" and so on. What is wrong here is that if I drop
>
> these
>
> two folders onto this applet "theName" will match
>
> "03personsnameaddress",
>
> "recNum" will match "03personsnameaddress", "theFolder" will match
>
> "03personsnameaddress" but "a_folder" will match
>
> "02personsnameaddress". How
>
> do I have all these variables identify with the same folder? Also,
>
> maybe of
>
> some importance, Mac OS 9.1 and AS 1.5.5.
>
> Thanks in advance for your help,
>
> Rick Norman
>
>
>
> on open theFolder
>
> set old_delimiters to AppleScript's text item delimiters
>
> set AppleScript's text item delimiters to ":"
>
> set n_items to the number of text items in (theFolder as string)
>
> set theName to text item (n_items - 1) in (theFolder as string)
>
> set AppleScript's text item delimiters to old_delimiters
>
> set recNum to text 1 thru 2 of theName as integer
>
> repeat with a_folder in theFolder
>
> display dialog "theName" & "-" & theName
>
> display dialog "recNum" & "-" & recNum
>
> display dialog "theFolder" & "-" & theFolder
>
> display dialog "a_folder" & "-" & a_folder
>
> end repeat
>
> end open
>
> _______________________________________________
>
> applescript-users mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.