Open file in folder
I have a filter set up where, it sends a torrent file to a certain foler with Pulp Fiction. I need an applescript that will open that added file(s) once it is added. Can someone help me out?
If I read your post correctly, you want to open any files that are added to this folder, correct?
If so, the following Folder Action script will open any files added:
on adding folder items to this_folder after receiving these_items
repeat with each_item in these_items
tell application "Finder" to open each_item
end repeat
end adding folder items to
Save it as a compiled script in /Library/Scripts/Folder Action Scripts using whatever name you like.
Then you can crtl-click on the folder in question and Attach a Folder Action.
Each time a file is added to the folder, the script will run and open the files.
You might want to add additional checks to make sure that only certain file types are opened.
Similar Messages
-
I can't double click in order to open file or folder
Dear apple support team,
I have the problem with open file or folder when using Mountain Lion, I can't open file or folder by double click in it. With Lion i can do it.
Please advice for me, i feel use Mountain Lion is difficult.Are you tapping to click, or pressing down the trackpad until it clicks? If you're tapping, try pressing.
-
Can't open files in folder shortcuts
Folder shortcuts simply appear as foldername.lnk in the Open file window. Anyone know a workaround?
Folder shortcuts simply appear as foldername.lnk in the Open file window. Anyone know a workaround?
-
Open files in folder and repeat
How can i open the files in the folder if you scroll to "--open file items of the name folder" you can see where I am struggling to run the script.
How should this look to run, currently the script runs, with no errors or anything appearing in the folders.
property type_list : {"PHOTOSHOP"}
property extension_list : {"psd"}
--Setup list of folders and process details of folders
set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
repeat with i from 1 to number of items in dtF
set this_item to item i of dtF
if this_item does not start with "2_" and this_item does not start with "Hot" and this_item does not start with "Press" then
try
set folderPath to this_item
set {oldTID, my text item delimiters} to {my text item delimiters, ":"}
set folderName to last text item of folderPath
set my text item delimiters to "_WK"
set FolderEndName to last text item of folderName
set brandName to first text item of folderName
set my text item delimiters to "_PSD"
set weekNumber to first text item of FolderEndName
set my text item delimiters to oldTID
set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
end try
end if
--set up names to destination folders and create locally based on brand name and week number
try
set this_local_folder to "Hal 9000:Users:matthew:Pictures:2011-2012"
set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
--set up names to destination folders and create over Netwrok including an already exisiting folder
set this_Network_folder to "DCKGEN:Brands:Zoom:Brand - Zoom:Upload Photos:2012:"
set networkWeekFolder to my getFolderPath("WK" & weekNumber, this_Network_folder)
set networkBrandFolder to my getFolderPath(brandName, networkWeekFolder)
set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkBrandFolder)
set website_images to "DCKGEN:Website_Images:"
--set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
set this_ftp_folder to "Impulse:"
set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
--taking the folder identify which process it must follow.
--open file items of the name folder
if brandName is equal to "Diva" then set filelist to (files of alias theFolder whose ¬
file type is in the type_list or name extension is in the extension_list)
repeat with alist in filelist
tell application "Finder"
set thefile to aFiles as alias
end tell
tell application "Adobe Photoshop CS5.1"
activate
set myOptions to {class:JPEG save options, quality:12}
tell front document
--If the quick mask mode has been left on then delete the channel Quick Mask
if (quick mask mode) then delete channel ¬
"Quick Mask"
delete layer "Original Image"
flatten
resize image resolution 300 resample method none
--sharpen image
filter current layer using unsharp mask with options ¬
{amount:80, radius:3.2, threshold:0}
save in file ((localBrandFolder_High_Res as string) & name) as JPEG with options myOptions without copying
tell application "Finder"
duplicate last file of localBrandFolder_High_Res to ftpBrandFolder_High_Res with replacing
end tell
--Prepare for Low RES by resetting image history
tell application "Adobe Photoshop CS5.1"
set current history state of current document to history state 3 ¬
of current document
end tell
resize image width 1020
resize image resolution 300 resample method none
filter current layer using unsharp mask with options ¬
{amount:80, radius:3.2, threshold:0}
--add save to lowResFolder with same options
save in file ((localBrandFolder_Low_Res as string) & name) as JPEG with options myOptions without copying
tell application "Finder"
duplicate last file of localBrandFolder_Low_Res to website_images with replacing
duplicate last file of localBrandFolder_Low_Res to ftpBrandFolder_Low_Res with replacing
duplicate last file of localBrandFolder_Low_Res to networkBrandFolder_Low_Res with replacing
end tell
--close file
close
end tell
end tell
end repeat
end try
end repeat
on getFolderPath(tName, folderPath)
tell application "Finder" to tell folder folderPath
if not (exists folder tName) then
return (make new folder at it with properties {name:tName}) as string
else
return (folder tName) as string
end if
end tell
end getFolderPathThis is how it looks.
A few things i need to add.
How can I save of time by not having to save to the multiple locations (i did try t using finder to duplicate last file of folder but that didn't work too well)
Also the line where it saves to website_images in need to exclude those files that end in _2 and _3 (or files that are exactly 16 digits long).
And finally if in photoshop it come across and error I need to skip the file and log it to a text file or just leave it open and continue.
Also how do I have it run in the background so i can continue to use the computer?
and finally any other way to make it run faster?
property type_list : {"8BPS"}
property extension_list : {"psd"}
--Setup list of folders and process details of folders
set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
repeat with i from 1 to number of items in dtF
set this_item to item i of dtF
if this_item does not start with "2_" and this_item does not start with "Hot" and this_item does not start with "Press" then
set folderPath to this_item
set {oldTID, my text item delimiters} to {my text item delimiters, ":"}
set folderName to last text item of folderPath
set my text item delimiters to "_WK"
set FolderEndName to last text item of folderName
set brandName to first text item of folderName
set my text item delimiters to "_PSD"
set weekNumber to first text item of FolderEndName
set my text item delimiters to oldTID
set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
--set up names to destination folders and create locally based on brand name and week number
set this_local_folder to "Hal 9000:Users:matthew:Pictures:2011-2012"
set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
--taking the folder identify which process it must follow.
--taking the folder identify which process it must follow.
set this_Network_folder to "DCKGEN:Brands:Zoom:Brand - Zoom:Upload Photos:2012:"
set networkWeekFolder to my getFolderPath("WK" & weekNumber, this_Network_folder)
set networkBrandFolder to my getFolderPath(brandName, networkWeekFolder)
set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkBrandFolder)
set website_images to "DCKGEN:Website_Images:"
--set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
set this_ftp_folder to "Impulse:"
set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
if brandName is equal to "Diva" then
tell application "Finder" to set filelist to (files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
repeat with thefile in filelist
set thefile to thefile as string -- convert Finder item to string
-- D I V A Folder Photoshop Process
tell application "Adobe Photoshop CS5.1"
activate
open alias thefile
set myOptions to {class:JPEG save options, quality:12}
tell current document
--If the quick mask mode has been left on then delete the channel Quick Mask
if (quick mask mode) then delete channel "Quick Mask"
(delete layer "Original Image") flatten
resize image resolution 300 resample method none
--sharpen image
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
save in (localBrandFolder_High_Res & name) as JPEG with options myOptions without copying
save in (ftpBrandFolder_High_Res & name) as JPEG with options myOptions without copying
--tell application "Finder"
--duplicate last file to folder ftpBrandFolder_High_Res with replacing
--end tell
-- example : duplicate file (localBrandFolder_High_Res & name) to folder localBrandFolder_Low_Res
--my duplicateFile(localBrandFolder_High_Res & name, localBrandFolder_Low_Res) -- use the handler to duplicate file
--Prepare for Low RES by resetting image history
set current history state to history state 3
flatten
resize image width 1920
resize image resolution 300 resample method none
filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
--add save to lowResFolder with same options
save in (localBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
save in (networkBrandFolder_Low_Res) as JPEG with options myOptions without copying
save in (ftpBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
save in (website_images & name) as JPEG with options myOptions without copying
close
--my duplicateFile(localBrandFolder_Low_Res & name, aFolderPath) -- use the handler to duplicate file
end tell
end tell
end repeat
-- end brandName = "Diva"
else if brandName is equal to "another brandName 1" then
--another code
else if brandName is equal to "another brandName 2" then
--another code
end if
end if
end repeat
on duplicateFile(tFilePath, folderPath)
tell application "Finder"
duplicate file tFilePath to folder folderPath with replacing
end tell
end duplicateFile
on getFolderPath(tName, folderPath)
tell application "Finder" to tell folder folderPath
if not (exists folder tName) then
return (make new folder at it with properties {name:tName}) as string
else
return (folder tName) as string
end if
end tell
end getFolderPath -
Open file & close folder that it's in - in one step
I want to be able to double click a file to open it and then the folder this file is in closes so that it is no longer open on my desktop. Is there a one step way to do this?
Yes.
Hold down the Option key while double-clicking the file.
This also works when opening sub-folders - the double-clicked folder will open and its enclosing folder will close. -
Open file in folder with command line program
I have a file, which is in native format for a given program [1] I have installed. This program I can start from Terminal.app and within the program I can open the file. The question is if I can have associated with this specific filetype this program and when I double click on a file of this type I can have a Terminal.app opened with my program running inside opening the file for me.
Btw, on a regular Linux/Unix I would just associate this filetype with the path to my program. On Mac I can associate only with .app.. Is there other way?
[1] http://root.cern.ch/drupal/I do not fully understand your question.
You need to make your program into an application. I have not programmed on Mac OS so I to not know the details. You could hack some existing app. I do know that the plist file for an app points to the starting program.
Another work around would be to write an apple script file to call your program.
This applescript invokes a unix program.
Run in the Script Editor.
Click on the Event Log tab to see the output from the log statement
Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- ask the user for the folder name.
-- quoted form of (POSIX path of (choose folder))
set theFolder to "/Applications/Utilities/Disk Utility.app"
set theFolder to quoted form of theFolder
log "quoted form is " & theFolder
-- running two Unix commands. Separate with a semicolon
set fromUnix to do shell script "cd " & theFolder & "; ls -ld ."
log fromUnix
display dialog fromUnix giving up after 30
end run
This applescript program received a file dropped on it.
There is a lot of extra stuff but look at on open dropped_items This line gets a list of files dropped on the applescript. Your have to change the name format.
on open dropped_items
-- Remember you need to turn on enable assistive devices
-- this lets applications software to access screen elements
-- blue apple > system perferences > universal access > enable assistive devices
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- set see to alias "Macintosh-HD:Users:mac:Desktop:app.html"
-- set dropped_items to {see}
set the_app to "Safari"
repeat with dropped_item_ref in dropped_items
--set UrlBase to "xzzx FILE://" & POSIX path of dropped_item_ref
--display dialog UrlBase
-- Activate
activate application the_app
-- Open the URL
tell application the_app
open dropped_item_ref
-- print dropped_item_ref
tell application "System Events"
tell process the_app
delay 3
-- click menu item "Print..." of menu "File" of menu bar 1
keystroke "p" using command down
delay 1
keystroke return
delay 10
keystroke "w" using command down
end tell
end tell
--quit
end tell
end repeat
end open -
Can't open files in folder on desktop
Have pictures in a folder under another folder on the user desktop. The user can't open the files, get an error of no permissions. GetInfo and ls -al from command line give same result, user has full permissions. Any idea what's going on?
Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
Step 1
If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
Step 2 (optional)
Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
Boot into Recovery. When the OS X Utilities screen appears, select
Utilities ▹ Terminal
from the menu bar. A Terminal window will open.
In the Terminal window, type this:
res
Press the tab key. The partial command you typed will automatically be completed to this:
resetpassword
Press return. A Reset Password window will open. You’re not going to reset a password.
Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
Select your username from the menu labeled Select the user account if not already selected.
Under Reset Home Directory Permissions and ACLs, click the Reset button.
Select
▹ Restart
from the menu bar. -
Applescript open file in hidden folders
When a folder is made visable and finder is reset then activating applescript to open file in folder, the once hidden folder but now visable in finder doesn't appear.
do shell script "defaults write com.apple.finder AppleShowAllFiles False"
-- kill Finder to make the changes active
do shell script "killall Finder"
then activate Applescript Editor and open file and the folder but folder will not appear.Aha, this seems to work, but I'm not sure why:
set the_file to (choose file) as text
tell application "Adobe Photoshop CS5"
open file the_file
end tell -
hi when i open my application folder, all the application is shown in trash folder. when i click the application it says this app is in trash first move it out. and when i try to open through finder> go it says this file doesn't exist. can some1 plz help? how can i put all my application through application folder?
Something really odd is going on. In your first screen shot, I noticed that the Applications folder does not have the proper icon displayed in the side bar. Also, in the title bar it lists it as Applications 08-59-29-909.
Not sure where it's picking up that odd name, unless it's because it's still truly within the Trash folder.
Try this. In the Finder > Preferences > General > turn on "Always open folders in a new window". (I have a feeling you have the default setting with this off).
Now, in Finder > Go > move down and open the Applications Folder from there. Now open the folder where you see all your applications that you show in your screen shot, select all, and move them to this true appliactions folder.
This is what you should properly seeing (but with different apps listed):
See how the Applications folder has the icon of the letter A shaped with a pencil, ruler & pen. -
HELP. ............Hi folks hope some one can help me please.Having a problem in Bridge I open my images in ACR, as I open files in a folder and lets say they are labeled in yellow they are all going back to the camera raw default , in other words no matter what work I have done, inc cropping they all go back to ,as they came out of camera. What on earth is happening? I am on PS CS6. I might point out everything was working normally up to yesterday, when this first started.
I recently changed computer to 64bit from 32bit, not sure if this causing the problem or not. Any help would be appreciated.Robert,
Would you be so kind to rephrase your question with concise, precise information and without any "let's say that" hypotheticals? Sorry, I can't quite follow you.
Also please give exact versions of Photoshop CS6 (13.what.what), of Bridge and of your OS.
Thanks.
BOILERPLATE TEXT:
If you give complete and detailed information about your setup and the issue at hand, such as your platform (Mac or Win), exact versions of your OS, of Photoshop and of Bridge, machine specs, what troubleshooting steps you have taken so far, what error message(s) you receive, if having issues opening raw files also the exact camera make and model that generated them, etc., someone may be able to help you.
Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
http://forums.adobe.com/thread/419981?tstart=0
Thanks! -
hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac, hi ! i am using mac air i download from app store IDESKTOP when i open it its delete all my file and folder on my mac
Here you can contact the developer.
(Notice, I'm posting this line only once. Not 4 times. ) -
How to systematically open file in a folder and process them with a program
Hello,
For my second question of the night.
I am wondering if there is a way to open every file in a folder, run them through a vi, and then append the output to an array or spreadsheet? This would save me lots of time and my wrists.
Thanks
Solved!
Go to Solution.Hi,
Yes you can open a file in the folder by using 'List folder' function (Programming>File I/O>Advvanced File Function>List Folder) which lists all the files and folders in the given path. From that you can build the path and give to 'Open File' function.
Hope this helps you. Let us know this solves your issue -
I have several old Kodak Photo CD with PCD image files. I am now using Photoshop CS5. Some years ago while using Photoshop CS4 I copied a file: "Photo CD.8BI" from an older, CS2, version to the Plug-ins/File Format folder of CS4. This does not appear to work with CS5. Any fix?
It can be made to work, but you have to run the 32 bit version of Photoshop CS5, and as I recall there's an additional DLL called pcdlib32.dll that's needed from the old installation.
See also: Open Kodak PhotoCD files in PS CS5 - is it possible? (Win XP)
-Noel -
How can I get a button to open a specific folder instead of opening a file?
I am using CS3 and ultimately outputting an interactive PDF file that I will be the "landing page" to launch files and folder structures. I have no problem launching the files but I am not a successful getting it to open a folder. I have tried several ways using the "go to file" and the "go to URL" actions and have pasted the folder path into each of these options assuming that it would work.
Can anyone give me some clue as to what I am doing incorrectly?It's definitely something that cannot be done in InDesign. It might be able to be done within Acrobat Pro, but you'd need to ask in the Acrobat forums.
-
Folder appears in Windows Explorer, but not in the Open File dialog
Hello,
I hope this is the right place to post this. If not, please let me know where is.
A friend just showed me a weird problem he is having with his computer. He is using Windows 7 pro, and has a folder under My Documents, in which he keeps his work files. He emails these files using Gmail, which he accesses via Internet Explorer.
All worked fine until a few days ago, when he noticed that when he clicked the link in Gmail to attach a file, his folder wasn't listed in the Open File dialog. He looked in Windows Explorer, and could see the folder OK. I tried opening Word and using the Open
File dialog there, and the folder wasn't visible.
If he clicks in the address bar, and adds the folder name to the path, it opens the folder, but shows it as empty. I actually has two subfolders. If he adds the name of a subfolder, then the Open File dialog shows the files in that folder.
I checked the permissions on the folder, and couldn't see anything odd. What I don't understand is how the folder can be visible in Windows Explorer, and not in the Open File dialog.
Anyone any ideas? Thanks
FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers.
Download from the Visual Studio Gallery.
If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at
http://dotnetwhatnot.pixata.co.uk/I can confirm - I'm having the exact same problem.
When I try to lookup or save a file from an IE file dialog some folders do not show up. I can type the folder name into the directory field and it then goes there, but this assumes you know the directory name and it's a PITB.
Firefox can browse to the directory directly.
It would be interesting if anyone else found a fix for this - I'll post here again if I find out more somewhere else, but there are not too many threads out there as far as I have found for now.
Found a solution over at answers at Microsoft dot com. (can post links here yet - will update once I can)
In short: There's a fast fix for this issue by resetting a hidden flag that IE sets for some folders. I believe this part of the "protected mode" feature, though I can't confirm and also have no idea how this would protect me from any intruders,
if only (unimportant) subfolders are protected ...
Anyway - if you know the name of the missing folder (e.g. from browsing the directories form windows explorer): in the parent directory that has the folder missing do a Search (in box at top right) for the missing
folder name. In my case the hidden folder shows up in the search - now right click -> Properties -> clear hidden flag. Note: this "hidden" flag is independent of the flags set in windows explorer - that's why you have trouble going there with IE and not
the file explorer from the desktop.
Maybe you are looking for
-
PS3 / Xbox 360 / PC Router Guide For GAMERS
Downloadable for Wordpad or Microsoft Word: http://www.filefactory.com/file/b1e67ga/n/Gaming_Router_Guide.rtf Or just read below: PS3, XBOX 360, PC GAMING Router Guide and Modem Guide Introduction: Having issues trying to get your PS3, or XBOX 360 fr
-
Query of Queries (QofQ) Escaped Character Problem
Hello All, I'm trying to run a query or queires (QofQ) and I'm doing a LIKE comparison that looks for bracket characters ([ ]) within a string, however ColdFusion is ignoring the brackets. How can I escape the bracket character? So far I have only be
-
Wrong GL account picked up by system..thus no posting
Hi, I am testing one standard sales cycle.After finishing everything when I try to release billing document, it gives me following error: G/L account 889000 is not defined in company code 9999(it's the C Code i defined) Message no. F5506 Diagnosis Th
-
Hi, I don't remind if it's possible, maybe you can help me... With an ALV ( in OO or not), how can I have a LABEL on a cell ? For instance, the cell value is "test" and when my mouse is on this cell my label could be "My long text for my test is a be
-
CFGRID and CFTREE applets not working
Problem I can't figure out: On my production machine ColdFusion outputs an OBJECT tag for a CFGRID or CFTREE generated applet and everything works fine. On my dev machine (same OS (Windows 2003, patch level, CF 5 service pack, same code) for some rea