AppleScript list of records to Swift Array (or better)
I test a little OSX app based on this example which use a bridge to AppleScript to get simple infos from iTunes.
Like I said in the ComboDrums's comment (it's me), I have a script to get all my iTunes playlists in a tree but as soon as the return is more complex than a simple string, it fails.
So I'm looking for the way to convert the AppleScript's list returned to a Swift friendly object.
Any idea ?
Thx.
Script:
to getStaticPlaylistsTree()
tell application "iTunes"
set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}}
end tell
return theList
end getStaticPlaylistsTree
arrays swift macos applescript itunes
add a comment |
I test a little OSX app based on this example which use a bridge to AppleScript to get simple infos from iTunes.
Like I said in the ComboDrums's comment (it's me), I have a script to get all my iTunes playlists in a tree but as soon as the return is more complex than a simple string, it fails.
So I'm looking for the way to convert the AppleScript's list returned to a Swift friendly object.
Any idea ?
Thx.
Script:
to getStaticPlaylistsTree()
tell application "iTunes"
set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}}
end tell
return theList
end getStaticPlaylistsTree
arrays swift macos applescript itunes
Post your code please.
– Willeke
Jan 20 at 15:10
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14
add a comment |
I test a little OSX app based on this example which use a bridge to AppleScript to get simple infos from iTunes.
Like I said in the ComboDrums's comment (it's me), I have a script to get all my iTunes playlists in a tree but as soon as the return is more complex than a simple string, it fails.
So I'm looking for the way to convert the AppleScript's list returned to a Swift friendly object.
Any idea ?
Thx.
Script:
to getStaticPlaylistsTree()
tell application "iTunes"
set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}}
end tell
return theList
end getStaticPlaylistsTree
arrays swift macos applescript itunes
I test a little OSX app based on this example which use a bridge to AppleScript to get simple infos from iTunes.
Like I said in the ComboDrums's comment (it's me), I have a script to get all my iTunes playlists in a tree but as soon as the return is more complex than a simple string, it fails.
So I'm looking for the way to convert the AppleScript's list returned to a Swift friendly object.
Any idea ?
Thx.
Script:
to getStaticPlaylistsTree()
tell application "iTunes"
set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}}
end tell
return theList
end getStaticPlaylistsTree
arrays swift macos applescript itunes
arrays swift macos applescript itunes
edited Jan 21 at 14:46
Willeke
7,75921024
7,75921024
asked Jan 20 at 14:29
user10177193user10177193
65
65
Post your code please.
– Willeke
Jan 20 at 15:10
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14
add a comment |
Post your code please.
– Willeke
Jan 20 at 15:10
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14
Post your code please.
– Willeke
Jan 20 at 15:10
Post your code please.
– Willeke
Jan 20 at 15:10
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14
add a comment |
1 Answer
1
active
oldest
votes
Firstly, Create the swift class or struct with a constructor having NSDictionary as parameter
struct SwiftModel {
// Declare attributes
init(dictionary: NSDictionary) {
self.isFolder = dictionary.value(forKey: "isFolder") as! Bool
self.isSmart = dictionary.value(forKey: "isSmart") as! Bool
self.theCount = dictionary.value(forKey: "theCount") as? Int
self.theID = dictionary.value(forKey: "theID") as? String
self.theName = dictionary.value(forKey: "theName") as? String
self.theClass = (dictionary.value(forKey: "theClass") as? NSAppleEventDescriptor)
}
}
Then, Using flatMap or compactMap convert apple script list to Swift Array.
let listFromAppleScript = // List returned from apple script i.e self.iTunesBridge.getStaticPlaylistsTree
let staticPlayListTree = listFromAppleScript?.compactMap({SwiftModel(dictionary: $0 as! NSDictionary)})
print(staticPlayListTree![0].theName)
Output: Optional("Bibliothèque")
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
|
show 4 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54277463%2fapplescript-list-of-records-to-swift-array-or-better%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Firstly, Create the swift class or struct with a constructor having NSDictionary as parameter
struct SwiftModel {
// Declare attributes
init(dictionary: NSDictionary) {
self.isFolder = dictionary.value(forKey: "isFolder") as! Bool
self.isSmart = dictionary.value(forKey: "isSmart") as! Bool
self.theCount = dictionary.value(forKey: "theCount") as? Int
self.theID = dictionary.value(forKey: "theID") as? String
self.theName = dictionary.value(forKey: "theName") as? String
self.theClass = (dictionary.value(forKey: "theClass") as? NSAppleEventDescriptor)
}
}
Then, Using flatMap or compactMap convert apple script list to Swift Array.
let listFromAppleScript = // List returned from apple script i.e self.iTunesBridge.getStaticPlaylistsTree
let staticPlayListTree = listFromAppleScript?.compactMap({SwiftModel(dictionary: $0 as! NSDictionary)})
print(staticPlayListTree![0].theName)
Output: Optional("Bibliothèque")
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
|
show 4 more comments
Firstly, Create the swift class or struct with a constructor having NSDictionary as parameter
struct SwiftModel {
// Declare attributes
init(dictionary: NSDictionary) {
self.isFolder = dictionary.value(forKey: "isFolder") as! Bool
self.isSmart = dictionary.value(forKey: "isSmart") as! Bool
self.theCount = dictionary.value(forKey: "theCount") as? Int
self.theID = dictionary.value(forKey: "theID") as? String
self.theName = dictionary.value(forKey: "theName") as? String
self.theClass = (dictionary.value(forKey: "theClass") as? NSAppleEventDescriptor)
}
}
Then, Using flatMap or compactMap convert apple script list to Swift Array.
let listFromAppleScript = // List returned from apple script i.e self.iTunesBridge.getStaticPlaylistsTree
let staticPlayListTree = listFromAppleScript?.compactMap({SwiftModel(dictionary: $0 as! NSDictionary)})
print(staticPlayListTree![0].theName)
Output: Optional("Bibliothèque")
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
|
show 4 more comments
Firstly, Create the swift class or struct with a constructor having NSDictionary as parameter
struct SwiftModel {
// Declare attributes
init(dictionary: NSDictionary) {
self.isFolder = dictionary.value(forKey: "isFolder") as! Bool
self.isSmart = dictionary.value(forKey: "isSmart") as! Bool
self.theCount = dictionary.value(forKey: "theCount") as? Int
self.theID = dictionary.value(forKey: "theID") as? String
self.theName = dictionary.value(forKey: "theName") as? String
self.theClass = (dictionary.value(forKey: "theClass") as? NSAppleEventDescriptor)
}
}
Then, Using flatMap or compactMap convert apple script list to Swift Array.
let listFromAppleScript = // List returned from apple script i.e self.iTunesBridge.getStaticPlaylistsTree
let staticPlayListTree = listFromAppleScript?.compactMap({SwiftModel(dictionary: $0 as! NSDictionary)})
print(staticPlayListTree![0].theName)
Output: Optional("Bibliothèque")
Firstly, Create the swift class or struct with a constructor having NSDictionary as parameter
struct SwiftModel {
// Declare attributes
init(dictionary: NSDictionary) {
self.isFolder = dictionary.value(forKey: "isFolder") as! Bool
self.isSmart = dictionary.value(forKey: "isSmart") as! Bool
self.theCount = dictionary.value(forKey: "theCount") as? Int
self.theID = dictionary.value(forKey: "theID") as? String
self.theName = dictionary.value(forKey: "theName") as? String
self.theClass = (dictionary.value(forKey: "theClass") as? NSAppleEventDescriptor)
}
}
Then, Using flatMap or compactMap convert apple script list to Swift Array.
let listFromAppleScript = // List returned from apple script i.e self.iTunesBridge.getStaticPlaylistsTree
let staticPlayListTree = listFromAppleScript?.compactMap({SwiftModel(dictionary: $0 as! NSDictionary)})
print(staticPlayListTree![0].theName)
Output: Optional("Bibliothèque")
edited Jan 22 at 15:26
answered Jan 22 at 15:20
Bharat KumarBharat Kumar
7115
7115
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
|
show 4 more comments
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
Ok thank you. CompactMap return a tree of the AppleScript list and flatMap an flat array of the list, right ?
– user10177193
Jan 22 at 15:36
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
And also, the getStaticPlaylistsTree to declare in the iTunesBridge.swift protocol needs to return a [NSString:AnyObject]? like in the trackInfo ? Thx.
– user10177193
Jan 22 at 15:53
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
getStaticPlaylists can be of type [NSDictionary] or [[String:Any]]
– Bharat Kumar
Jan 22 at 16:48
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
in this scenario you can use either compactMap or flatMap but for more clarification you can refer stackoverflow.com/questions/49291057/…
– Bharat Kumar
Jan 22 at 16:53
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
Ok thank you. But how the map do to get the children’s tree ? In my example there is no children but in the final tree there are a lot in the theChildren property.
– user10177193
Jan 22 at 16:55
|
show 4 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54277463%2fapplescript-list-of-records-to-swift-array-or-better%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Post your code please.
– Willeke
Jan 20 at 15:10
The code is in the project example (github.com/hhas/Swift-AppleScriptObjC). I just added a method to get a static tree of some playlists like : to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList. Thx.
– user10177193
Jan 20 at 15:16
Please post the formatted code in the question.
– Willeke
Jan 20 at 16:20
I can't format the code because I can't post answer with my account... 😂 So sorry but I can't. Can you copy/paste the code in a simple AppleScript script? It is the same... to getStaticPlaylistsTree() tell application "iTunes" set theList to {{theName:"Bibliothèque", theID:"66270731FDBE2C50", isFolder:false, theClass:library playlist, isSmart:false, theCount:37581}, {theName:"Clips vidéo", theID:"07D5032B96891D67", isFolder:false, theClass:user playlist, isSmart:true, theCount:283}} end tell return theList end getStaticPlaylistsTree
– user10177193
Jan 21 at 14:14