|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: |
(* Change Path Script for Portfolio 8.5 *)
-- Check to make sure Portfolio is running
tell application "Finder" to set P_app to every process whose name contains "Portfolio"
if P_app is {} then
display dialog ¬
"Portfolio must be running for this script to operate." buttons {"OK"} default button {"OK"}
return
end if
tell application "Portfolio"
-- Check to make sure a catalog is opened
tell application "Portfolio" to set windowCount to count every document
if not (exists of document 1) then
display dialog ¬
"A Portfolio catalog must be opened for this script to operate." buttons {"OK"} default button {"OK"}
return
end if
--Get the appropriate search information from the user
set sSearch to text returned of (display dialog "Enter the beginning of the path to be replaced:
(e.g. Macintosh HD:FolderName:)" default answer "")
set sReplace to text returned of (display dialog "Edit this path to match how it should be edited for Items in the catalog:" default answer sSearch)
if name of selected gallery of the front document ` name of gallery 1 of the front document then
set cButton to button returned of (display dialog "Edit items in the current gallery, or the whole catalog? " buttons {"Entire Catalog", "Current Gallery"} default button 1)
else
set cButton to "Entire Catalog"
end if
-- pad the strings with ":" at the end
(*
if the last character of sSearch ` ":" then set sSearch to sSearch & ":"
if the last character of sReplace ` ":" then set sReplace to sReplace & ":"
*)
set searchLength to length of sSearch
set replaceLength to length of sReplace
-- go to the proper gallery
if cButton = "Entire Catalog" then
tell the front document to display gallery 1
end if
set currentGallery to name of selected gallery of the front document
set recordCount to count every record of gallery currentGallery of the front document
set myIndex to 1
set replaceCount to 0
tell gallery currentGallery of the front document
repeat recordCount times
if file path of record myIndex starts with sSearch then
tell record myIndex
set thePath to file path as Unicode text
set recordLength to the length of thePath
set file path to sReplace & characters (searchLength + 1) through (recordLength) of thePath
set replaceCount to replaceCount + 1
end tell
end if
set myIndex to myIndex + 1
end repeat
end tell
-- If no items were found, tell the user and then quit.
if replaceCount is 0 then
display dialog ¬
"No Item Paths were found to match the Path entered.
Be sure you are entering the beginning of the path you want to edit (e.g. Macintosh HD:FolderName), not an item within the path (e.g. FolderName)." with icon 2 buttons {"OK"} default button {"OK"}
return
else
display dialog ¬
"Script completed. " & replaceCount & " items edited. " & "
Items found with a matching file path have been edited." buttons {"OK"} default button {"OK"}
end if
end tell
|
Advertisement
| Hall of Fame |