"run an applescript" Code Answer's
You're definitely familiar with the best coding language TypeScript that developers use to develop their projects and they get all their queries like "run an applescript" answered properly. Developers are finding an appropriate answer about run an applescript related to the TypeScript coding language. By visiting this online portal developers get answers concerning TypeScript codes question like run an applescript. Enter your desired code related query in the search bar and get every piece of information about TypeScript code related question on run an applescript.
run an applescript
on run {input, parameters}
tell application "Finder"
--get the selected file
set selectedItem to (item 1 of (get selection))
--get location info (folder:file format)
set fileLocation to (selectedItem as alias) as string
--replace : with / with subroutine
set the semifinal to my replace_chars(fileLocation, ":", "/")
--remove Macintosh HD with subroutine
set the theFinal to my replace_chars(semifinal, "Macintosh HD", "")
end tell
do shell script "osascript " & "\"" & theFinal & "\""
return input
end run
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
Source: superuser.com
All those coders who are working on the TypeScript based application and are stuck on run an applescript can get a collection of related answers to their query. Programmers need to enter their query on run an applescript related to TypeScript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about run an applescript for the programmers working on TypeScript code while coding their module. Coders are also allowed to rectify already present answers of run an applescript while working on the TypeScript language code. Developers can add up suggestions if they deem fit any other answer relating to "run an applescript". Visit this developer's friendly online web community, CodeProZone, and get your queries like run an applescript resolved professionally and stay updated to the latest TypeScript updates.