1

Just 3 lines of script to be able to test a droplet application without leaving applescript editor

set fich to POSIX file "/Appli/conv2spct.app" as string

 tell application "Finder" to open POSIX file "/Users/yourusername/Desktop/somefile" using application file fich

If there are errors in your droplet a display dialog will be opened by the script editor applescript

deek5
  • 367
  • 1
  • 13
  • Good stuff, but I suggest making it clearer why your code is necessary (Script Editor will launch a stay-open application being developed, but won't keep it open). I suggest explaining just the need for your solution in the question, and moving both solutions into your answer. – mklement0 Nov 11 '16 at 18:35

3 Answers3

1

The same script with choose file for the 2 elements

set fileappli to POSIX path choose file of type {"APPL"} with prompt "Choose a Droplet application to debug"--the droplet for debug

set fileargument to POSIX path choose file --the file argument to pass at droplet 

tell application "Finder" to open fileargument using application file fileappli

If there are errors in your droplet a display dialog will be opened by the script editor applescript

mklement0
  • 382,024
  • 64
  • 607
  • 775
deek5
  • 367
  • 1
  • 13
0

Here's a pragmatic alternative using do shell script, which potentially allows you to specify multiple file arguments:

do shell script "open -a /Appli/conv2spct.app ~/Desktop/somefile1 ~/Desktop/somefile2"

The above paths happen not to need quoting (escaping) for the shell, but when using variables to specify the file paths, it's best to use quoted form of (to pass multiple arguments, apply quoted form of to each):

do shell script "open -a " & quoted form of fileappli & " " & quoted form of fileargument
mklement0
  • 382,024
  • 64
  • 607
  • 775
0

Looks like this has become simpler since the question was first asked. According to this documentation you can write:

open {choose file}
on open theDroppedItems
  ...
end open

Run this from within the AppleScript editor and the file you choose will be opened as if it had been dropped onto the compiled script.

BruceH
  • 494
  • 6
  • 11