• 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: finder - how do I rename/move this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finder - how do I rename/move this?


  • Subject: Re: finder - how do I rename/move this?
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 23 Dec 2011 18:10:32 -0700

On Dec 23, 2011, at 2:19 PM, DealTek wrote:

> How do I get your result from ...
>
> set parent_folder to POSIX file "/bu1/bu1a" as alias
> tell application "Finder"
> 	folders of (parent_folder) whose name begins with "THIS-FOLDER"
> end tell
>
> into a var like:
>
> set FOLDER1 to ...... and your result answer.... ?
>
> --- I tried :
>
> set FOLDER1 to folders of (parent_folder) whose name begins with "THIS-FOLDER"
>
> but it fails...
>
> How do I do it correctly?

set parent_folder to POSIX file "/bu1/bu1a" as alias
tell application "Finder"
        set FOLDER1 to folder 1 of (folders of parent_folder whose name begins with "THIS-FOLDER") as alias
end tell
Result:
alias "Dora:bu1:bu1a:THIS-FOLDER_2011-12-22_2245:"


Alternatively, you can omit "as alias" if you want a Finder object instead of an alias:
set parent_folder to POSIX file "/bu1/bu1a" as alias
tell application "Finder"
	set FOLDER1 to folder 1 of (folders of parent_folder whose name begins with "THIS-FOLDER")
end tell
Result:
folder "THIS-FOLDER_2011-12-22_2245" of folder "bu1a" of folder "bu1" of startup disk of application "Finder"

-- Michelle

--
Power is the ability to not have to please.

 _______________________________________________
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

References: 
 >finder - how do I rename/move this? (From: Dave <email@hidden>)
 >Re: finder - how do I rename/move this? (From: Michelle Steiner <email@hidden>)
 >Re: finder - how do I rename/move this? (From: DealTek <email@hidden>)
 >Re: finder - how do I rename/move this? (From: DealTek <email@hidden>)

  • Prev by Date: Re: Folder Actions Scripts
  • Next by Date: Re: finder - how do I rename/move this?
  • Previous by thread: Re: finder - how do I rename/move this?
  • Next by thread: Re: finder - how do I rename/move this?
  • Index(es):
    • Date
    • Thread