5

I'm new to AppleScript and after doing:

set folder_name to "New_Folder"
tell application "Finder" to make new folder at desktop
set my_folder to result as alias
tell application "Finder" to set the name of my_folder to folder_name
get my_folder

I get: alias "/Users/frank/Desktop/untitled folder"

I thought alias was dynamic, why my_folder reference is not changing after renaming the folder? i.e. alias "/Users/frank/Desktop/New_Folder"

How can I accomplish that?

1
  • I am getting the same issue on Mac OS High Sierra 10.13.6 (17G65)
    – donileo
    Commented Aug 23, 2018 at 21:42

1 Answer 1

1

I'm not quite sure why you're not getting the correct information. Running your code on my system (macOS High Sierra) returns the correct alias to the renamed folder.

enter image description here

This code should return the proper value for the alias value you are looking for

set folder_name to "New_Folder"
tell application "Finder" to set my_folder to ¬
    (make new folder at desktop with properties {name:folder_name}) as alias
return my_folder
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .