Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript App won't quit after in has run?

I've create a number of scripts using the New from template Cocoa Applescript applet .


The script runs without a problem but does not quit.


What else should I do to make this work correctly?

-- main.scpt

-- Cocoa-AppleScript Applet

--

-- Copyright 2011 {Your Company}. All rights reserved.


-- This is the main script for a Cocoa-AppleScript Applet.

-- You can put the usual script applet handlers here.

property SS : "\\"

property RS : "/"

on run

tell application "Finder" to set theSelection to selection



set output to {}

set tid to AppleScript'stext item delimiters

repeat with thisItem in theSelection


set AppleScript'stext item delimiters to ":"

set pathList to text items of (thisItem as text)


set item 1 of pathList to "DCKGEN"

set AppleScript'stext item delimiters to "\\"

set beginning of output to ("file://///uranus/" & pathList as text)


end repeat

set AppleScript'stext item delimiters to return

set output to output as text

set AppleScript'stext item delimiters to tid

set output to (my replaceText(output, SS, RS))


set the clipboard tooutput as text

end run



to replaceText(sometext, oldItem, newItem)

set {tempTID, AppleScript'stext item delimiters} to {AppleScript'stext item delimiters, oldItem}

try

set {itemList, AppleScript'stext item delimiters} to {text items of sometext, newItem}

set {sometext, AppleScript'stext item delimiters} to {itemList as text, tempTID}

on error errorMessagenumbererrorNumber-- oops

set AppleScript'stext item delimiters to tempTID

error errorMessagenumbererrorNumber-- pass it on

end try


return sometext

end replaceText

iMac, OS X Mavericks (10.9.4)

Posted on Jun 2, 2015 5:55 AM

Reply
5 replies

Applescript App won't quit after in has run?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.