Automatically launch Citrix client from Safari
Automatically launch Citrix client from Safari
- Subject: Automatically launch Citrix client from Safari
- From: BunMan <email@hidden>
- Date: Wed, 27 Jul 2005 01:22:30 +0100
Hi,
I tried to author a simple AppleScript to allow me to automate launching a Citrix client on my Mac (OS X Panther 10.3.9) whenever I click on a special hyperlink in Safari which downloads a file called "launch.asp". I recall testing it and seeing the following implementation work as designed. But it doesn't work now.
The canonical filename of the file that I want AppleScript to automatically launch upon being copied to my designated download folder is "launch.asp". But I also need to handle the case where Safari copies the downloaded file using incremented filenames like:
launch-1.asp
launch-2.asp
etc . . .
whenever a file called "launch.asp" already exists in the download folder.
Prior to writing the following script, I have nil experience using AppleScript, so please be gentle.
Here's the code that doesn't work, please advise:
set AppleScript's text item delimiters to {":"}
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to the number of items in added_items
set the_file to item i of added_items
set the_filename to get last text item of (the_file as string)
if (the_filename begins with "launch") and ¬
(the_filename ends with ".asp") then
tell application "Finder"
open the_file
move the_file to the trash
end tell
end if
end repeat
end adding folder items to
tell application "Safari"
close window "Downloads"
end tell _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden