![]() ![]() To make this list into a single piece of text with one city per line, use the list that contains city names only set the text item delimiters to linefeed then coerce the list to text. This returns a list of all the city names (or a list of lists of IP address-city name pairs if you elect to use the line I commented out as an alternative). Set URLQueryString to "?access_key=" & the APIKey & "&fields=city" After the repeat loop is complete, your final command would simply be a reference to that list so as to have AppleScript evaluate its contents and return the result: set APIKey to "" This worked for me to get the app's path and append a subdirectory set currentpath to (POSIX path of (container of (path to me) as alias)) & 'subdirectory/'. You can do this by first declaring a variable as an empty list, into which you would add an item of data in each iteration of your repeat loop. If posix path is needed add the following command before end tell : set p to POSIX path of currentpath. So for a more comprehensive solution, you can edit your script slightly so that the last command will be one that returns what you actually want. macos replace applescript clipboard Share Improve this question Follow asked at 11:33 TabulaRasa 131 1 4 13 Add a comment 2 Answers Sorted by: 6 This is possible using get clipboard, set clipboard, and the text item delimiters. The final command in your script will be set cityName to city of json, and so the result of your script will be the value of cityName after it has been set to the value from the JSON record that pertains specifically to the last IP address in your list, i.e. ![]() It will print a live result from each AppleScript command executed during the run of a script, whereas the Results pane only returns the overall result of the script's execution (which equates to the result of only the final command). The immediate solution would be to use the Replies pane rather than the Results pane in Script Editor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |