Dudes, i made one applescritp for my work, and now i want to do a little upgrade!
You can read all the discussion and my script here: http://macscripter.net/viewtopic.php?id=29297
And Actual my scritp is this:
property volumeNames : "MNOPQRSTUVX"
property targetVolumeList : {"MO", "PPC", "SEO", "Planejamento", "Criacao", "Publico", "WWW", "MP3", "Projetos Dotnet", "Producao", "Desenvolvimento"}
property targetServidorList : {"srvfs-novo", "srvfs-novo", "srvfs-novo", "srvfs-novo", "srvfs-md", "srviis-md", "srviis-md", "srviis-md", "srviis-md", "srvfs-md", "srvfs-md"}
on open theFiles
try
set WindowsFilePath to item 1 of theFiles as text
set AppleScript's text item delimiters to ":"
set theTextItems to text items of WindowsFilePath
set AppleScript's text item delimiters to "\\"
set WindowsFilePath to theTextItems as string
set AppleScript's text item delimiters to {""}
set theVolume to item 1 of theTextItems
set strFilePath to items 2 thru (theTextItems count) of theTextItems
set AppleScript's text item delimiters to "\\"
set finalPath to strFilePath as string
set AppleScript's text item delimiters to {""}
if theVolume is in targetVolumeList then
repeat with i from 1 to count targetVolumeList
if theVolume is item i of targetVolumeList then
exit repeat
end if
end repeat
set targetLetter to character i of volumeNames
end if
set windowsFinalPath to targetLetter & ":\\" & finalPath
set the clipboard to windowsFinalPath
tell application "GrowlHelperApp"
set the allNotificationsList to {"Moises trabalhando"}
set the enabledNotificationsList to {"Moises trabalhando"}
register as application "Moises" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor"
notify with name "Moises trabalhando" title "Moises transformou o caminho" description windowsFinalPath application name "Moises"
end tell
end try
end open
on run
set strClipboard to the clipboard
set strFirstLetter to first character of strClipboard
set strLastCharacter to last character of strClipboard
if strLastCharacter = "\\" then
set strClipboard to text 3 thru -2 of strClipboard
else if strLastCharacter = " " then
set strClipboard to text 3 thru -2 of strClipboard
else
set strClipboard to text 3 thru -1 of strClipboard
end if
if strFirstLetter is in volumeNames then
set o to offset of strFirstLetter in volumeNames
set targetVolume to item o of targetVolumeList
set targetServidor to item o of targetServidorList
else
display dialog "Server or file not found"
return
end if
set AppleScript's text item delimiters to "\\"
set theTextItems to text items of strClipboard
set AppleScript's text item delimiters to ":"
set strClipboard to theTextItems as string
set AppleScript's text item delimiters to {""}
set targetMacPath to targetVolume & strClipboard
tell application "Finder"
activate
set mountedVolumes to list disks
if mountedVolumes does not contain targetVolume then
mount volume "smb://" & targetServidor & "/" & targetVolume
open folder targetMacPath
(*select targetMacPath
select targetMacPath*)
else
open folder targetMacPath
(*select targetMacPath
select targetMacPath*)
end if
end tell
tell application "GrowlHelperApp"
set the allNotificationsList to {"Moises trabalhando"}
set the enabledNotificationsList to {"Moises trabalhando"}
register as application "Moises" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Moises 2.0"
notify with name "Moises trabalhando" title "Moises abriu o caminho" description targetMacPath application name "Moises"
end tell
end run
What i want is someting like that!
Whenever the script cannot run, or didn’t find the correct way to target folder, where have the code:
display dialog "Server or file not found"
I wanna open a Historic os last 10 opened folders in finder! This is possible? How i supose to save this lasts filepath? I Don’t need full historic, i need save until user shutdown or reboot!
Thanks for help!