Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

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
Comment

PREVIOUS NEXT
Code Example
Typescript :: git merge all previous commits on a branch 
Typescript :: open dialog 
Typescript :: htmlspecialchars() expects parameter 1 to be string array given in laravel blade 
Typescript :: restaurants near me 
Typescript :: how to check if object is undefined in typescript 
Typescript :: HHow to append lists elixir 
Typescript :: ERROR Error: mat-form-field must contain a MatFormFieldControl. 
Typescript :: makestyles material ui typescript 
Typescript :: onblur vs valuechange 
Typescript :: object is possibly 
Typescript :: split in angular 8 
Typescript :: what project management tool you use 
Typescript :: typescript annotate return type 
Typescript :: typescript vite static assets 
Typescript :: Angular Compiler Options to enable AOT compilation 
Typescript :: how to permit only a few values in dbms 
Typescript :: how to create an unknown amount of objects in c++ 
Typescript :: W/TextToSpeech: speak failed: not bound to TTS engine site:stackoverflow.com 
Typescript :: feature counts bioconda 
Typescript :: React import multiple components from a folder 
Typescript :: react input onchange typescript 
Typescript :: dynamic key 
Typescript :: From the three types of styling, which one is the most useful in terms of website optimization? 
Typescript :: ts push in array 
Typescript :: how many straight and curves are there in a standard track 
Typescript :: woocommerce remove This is where you can add new products to your store in taxonomy description 
Typescript :: typescript watch mood 
Typescript :: how to disable piecelabel on certian charts and keep on other chartjs 
Typescript :: 5 lakes of north america 
Typescript :: where do you store your test data 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =