• 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: Booleans in AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Booleans in AS


  • Subject: Re: Booleans in AS
  • From: "Paul F. Henegan" <email@hidden>
  • Date: Thu, 07 Mar 2002 07:57:52 -0500

on 07.03.2002 07:10, John Cochrane at email@hidden wrote:

> Andy Wylie wrote:
>
>> for occasions when "2output2" may exist try...
>>
>> tell application "Finder"
>> set {folName, cnt} to {"Test", 0}
>> set |exists| to (get exists of folder named folName of desktop)
>> repeat until |exists| = false
>> set cnt to cnt + 1
>> set folName to folName & cnt
>> set |exists| to (get exists of folder named folName of
> desktop)
>> end repeat
>> set newFolder to (make new folder at desktop with properties
>> {name:folName})
>> end tell
>
> When I tried this successive folders were created named Test1, Test12,
> Test123 etc. instead
> of Test1, Test2, Test3 etc
> I assume I have to conveert to number from text but as a relative
> newcomer I had trouble
> doing this. Any suggestions?
>
Hi John,

Try adding an additional variable newFolName so that you are making the
changes to the same base name. It should look something like this:

======================================================================

tell application "Finder"
set {folName, cnt} to {"Test", 0}
set newFolName to folName
set |exists| to (get exists of folder named newFolName of desktop)
repeat until |exists| = false
set cnt to cnt + 1
set newFolName to folName & cnt
set |exists| to (get exists of folder named newFolName of
[NO-BREAK]desktop)
end repeat
set newFolder to (make new folder at desktop with properties
[NO-BREAK]{name:newFolName})
end tell

======================================================================
[formatted using ScriptToEmail - gentle relief for mailing list pains]
[http://files.macscripter.net/ScriptBuilders/ScriptTools/ScriptToEmail.hqx]

HTH,

paul
--
Paul F. Henegan
<email@hidden>
_______________________________________________
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.

  • Follow-Ups:
    • Re: Booleans in AS
      • From: John Cochrane <email@hidden>
References: 
 >Re: Booleans in AS (From: John Cochrane <email@hidden>)

  • Prev by Date: Re: Booleans in AS
  • Next by Date: Re: Booleans in AS
  • Previous by thread: Re: Booleans in AS
  • Next by thread: Re: Booleans in AS
  • Index(es):
    • Date
    • Thread