Hey im totaly new to this scripting. Ive made 2 scripts to activate a diffrent version of an application i use.
try
tell application "Finder"
if (exists (POSIX file "/Applications/Vio Applications/SendToMe")) is false then
open document file "SendToMe.zip" of folder "Vio Applications" of folder "Applications" of startup disk
end if
end tell
end try
try
tell application "Finder"
if exists (POSIX file "/Applications/Vio Applications/Vio Support Material/SendToMe") then
delete (POSIX file "/Applications/Vio Applications/Vio Support Material/SendToMe")
end if
end tell
end try
delay 0.8
try
tell application "Finder"
close Finder window "vio applications"
end tell
end try
And another one visa versa. Basicaly id like to connect these to a droplet application. I drop a pdf onto the app for uploading to print. is it possible to trigger my script from droping the pdf onto this application?
Any advice much appreciated thx.
(edit: to make sure im clear - the only way the droplet works is if i drop a pdf onto it, theres no way to open the app and open the pdf inside so i cant have a script that opens the uploader droplet. the action of droping the pdf needs to be the start of the chain)
Hi Dominic,
of course it is.
I modified your script a bit by using shell commands,
ditto extracts zip files without a Finder window and rm deletes without checking if the file exists.
on run
display dialog "please drag file(s) onto the droplet" buttons {"OK"} default button 1 with icon 2
end run
on open theseFiles
set VioAppsFolder to ((path to applications folder as text) & "Vio Applications:")
set VioAppsFolderPOSIX to POSIX path of VioAppsFolder
try
(VioAppsFolder & "SendToMe") as alias -- throws an error if file doesn't exist
on error
-- ditto extracts a zip-file without opening a Finder window
do shell script "/usr/bin/ditto -xk " & quoted form of (VioAppsFolder & "SendToMe.zip") & space & quoted form of VioAppsFolder
end try
do shell script "/bin/rm -rf " & quoted form of (VioAppsFolder & "Vio Support Material/SendToMe")
end open
Save the script as application bundle
Thanks for the script seems much more professional then mine ;p But its saying no such file or directory, i dnt rly understand your script to check it out
I guess i wasnt very clear with my blurb though, i tend to ramble rather incoherently. Il try and be abit clearer.
Ok so the dropplet app isnt my script its a seperate program - Telegraph delivery - i need to drop the file onto this app and have it trigger my script. Not drop the pdf onto my scripted app since the Tele delivery only works from a pdf dropped onto it. Duno if that makes more sence?