Question: I'm trying to open iCloud in the current Finder window/tab. The below AppleScript works with any other folder.

How can I open iCloud in the current Finder window with AppleScript?

```
tell application "Finder"
    reopen
    activate
    set p to "~/Library/Mobile Documents/"
    set target of Finder window 1 to POSIX file p
end tell

```

Answer: 
This isn't a complete answer because this won't open the *iCloud* folder in the current tab, but it *does* open the *iCloud* folder rather than the `"Mobile Documents"` folder:

```
tell application "System Events" to open folder "~/Library/Mobile Documents"

```

I'm not familiar with any method that will give you the best of both worlds. It seems that you either must settle for the `"Mobile Documents"` folder opening in the tab you want; or a new tab being created to open the folder you want.
This is easy.
Create an alias of the iCloud folder and place that on the local hard drive then use Apple Script to open the alias and that opens the iCloud folder:
set itemPath to "Macintosh HD:Users:username:folder:alias\_name"
tell application "Finder"
set theItem to item itemPath
if (class of theItem) is folder then activate
open theItem
end tell