Referencing Files and Folders in AppleScript
- Ptsx File View App For Mac Free
- Ptsx File View App For Mac Download
- Ptsx File View App For Mac Computer
- Ptsx File View App For Mac Windows 10
In AppleScript, file and folder paths are typically represented using
alias
, file
, and POSIX file
objects.The new file can be found in the same folder as the original file you converted. If you followed the test with userguide.ps, you may not see a new file; this is because the original userguide.pdf that was there was overwritten with the new one, created by the conversion you just performed. Performing a 'Get Info' on the file will reveal the updated modification date. Bottomline PT-X helps businesses pay and get paid with features which include Bacs and Faster Payments processing, Direct Debit & card collections as well as invoice & billing management. This app features: - Two-step verification for your PT-X account to provide an additional layer of se. Jan 13, 2013 I just called Microsoft as I wanted to back up my 'pst' file on my MBA. Turns out that there is no pst file in outlook for mac 2011. Instead it relies on a database that is located as below: Documents - Microsoft User Data - Office 2011 Identies - Main Identity. The 'main identity' folder holds all the data from email, calander, etc.
Note
Additional information about working with file and folder paths in AppleScript can be found in Aliases and Files in AppleScript Language Guide.
Alias Objects
An
alias
object dynamically points to an existing item in the file system. Since an alias is dynamic, it continues pointing to the item even if the item is renamed or moved, the same way an alias file works when you manually create one in the Finder. With an AppleScript alias, the original item must exist at run time or an error will occur. An
alias
object is displayed as a colon-delimited path preceded by an alias
specifier, in the format shown in Listing 15-1.APPLESCRIPT
Listing 15-1AppleScript: Structure of an alias objectalias 'VolumeName:FolderName:SubfolderName:FileName'
![Ptsx file view app for mac free Ptsx file view app for mac free](/uploads/1/2/6/4/126485989/558879319.jpg)
Listing 15-2 shows an example of an
alias
object that references the Desktop folder.APPLESCRIPT
Listing 15-3 is an example of an
alias
object that references an existing file on the Desktop.APPLESCRIPT
Listing 15-3AppleScript: Example of an alias reference to a filealias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
To create an alias, add the alias specifier prefix to a colon-delimited path string, as shown in Listing 15-4.
APPLESCRIPT
Listing 15-4AppleScript: Creating an alias from a colon-delimited path stringset thePath to alias 'Macintosh HD:Users:yourUserName:Desktop:'
Many commands accept an alias as a parameter and/or return an alias as a result. In Listing 15-5, the
choose file
command accepts a folder alias
object in its default location
parameter. The command then returns an alias
object that points to the chosen file.APPLESCRIPT
Listing 15-5AppleScript: Example of a command that accepts an alias parameter and returns an alias resultset theDefaultFolder to alias 'Macintosh HD:Users:yourUserName:Desktop:'
choose file default location theDefaultFolder
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
File Objects
A
file
object is a static reference to an item at a specific location in the file system. It’s not dynamic, and can even refer to an item that doesn’t exist yet. For example, a save
command may accept a file reference when saving to a new file. A
file
object is displayed as a colon-delimited path preceded by a file
specifier, in the format shown in Listing 15-6.APPLESCRIPT
Listing 15-6AppleScript: Structure of a file objectfile 'VolumeName:FolderName:SubfolderName:FileName'
Listing 15-7 shows an example of a
file
object that references a file that may or may not exist on the Desktop.APPLESCRIPT
Listing 15-7AppleScript: Example of a file reference to a filefile 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
Unlike the way an
alias
object works, you can’t create a file
object simply by prefixing a path string with the file
specifier. For example, Listing 15-7 errors when run within a script.APPLESCRIPT
Listing 15-8AppleScript: Example of incorrect usage of a file object specifierset theFile to file 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
Instead, you must prefix the path with the
file
specifier at the time the file is targeted by a command, as shown in Listing 15-8.APPLESCRIPT
Listing 15-9AppleScript: Example of correct usage of a file object specifierset theFile to 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
read file theFile
Note
A
file
object can refer to either a file or a folder, despite the file
specifier prefix. POSIX File Objects
Some scriptable apps are designed to work with POSIX-style paths, rather than AppleScript
alias
and file
objects. Like a file
object, a POSIX file
object is not dynamic and can also refer to an item that doesn’t exist yet. A
POSIX file
object is displayed as a slash-delimited path preceded by a POSIX file
specifier, in the format shown in Listing 15-10.APPLESCRIPT
Listing 15-11 is an example of a
POSIX file
object that references a file that may or may not exist on the Desktop.APPLESCRIPT
Listing 15-11AppleScript: Example of a POSIX file reference to a filePOSIX file '/Users/yourUserName/Desktop/My File.txt'
Note
A
POSIX file
object can refer to either a file or a folder, despite the POSIX file
specifier prefix. In a POSIX path, the startup disk’s name is omitted and represented by a leading slash. Other disks are referenced in relation to the
Volumes
directory of the startup disk, for example: /Volumes/DiskName/FolderName/SubFolderName/FileName
.App-Specific References to Files and Folders
Some apps, such as the Finder and System Events, have their own syntax for referring to files and folders. Listing 15-12 shows how a Finder file reference appears.
APPLESCRIPT
Listing 15-12AppleScript: Example of a reference to a file in the FinderPtsx File View App For Mac Free
document file 'My File.txt' of folder 'Desktop' of folder 'yourUserName' of folder 'Users' of startup disk of application 'Finder'
Listing 15-13 shows how a System Events folder reference appears.
APPLESCRIPT
Listing 15-13AppleScript: Example of a reference to a folder in System Eventsfolder 'Macintosh HD:Users:yourUserName:Desktop:' of application 'System Events'
Since this terminology is app-specific, it doesn’t work in other apps. For example, you can’t write a script that tries to import a Finder reference to an audio file into iTunes because iTunes doesn’t understand Finder file references. In this case, you must coerce the Finder file reference to something iTunes can understand, like an alias. See Converting Between Path Formats below. In most cases, apps with their own path syntax also support standard AppleScript path types.
Converting Between Path Formats
Since different situations may result in paths appearing in different formats, you may need to regularly convert one path format to another. Sometimes, this can be done by using the
as
coercion operator, as shown in Listing 15-14, Listing 15-15, Listing 15-16, and Listing 15-17.APPLESCRIPT
Listing 15-14AppleScript: Coercing a string to an aliasset theFilePath to 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
set theFilePath to theFilePath as alias
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
APPLESCRIPT
Listing 15-15AppleScript: Coercing an alias to a stringset theFilePath to choose file
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
set theFilePath to theFilePath as string
--> Result: 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
APPLESCRIPT
Listing 15-16AppleScript: Coercing a POSIX file to an aliasset theFilePath to POSIX file '/Users/yourUserName/Desktop/My File.txt'
set theFilePath to theFilePath as alias
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
APPLESCRIPT
Listing 15-17AppleScript: Coercing a Finder file reference to an aliastell application 'Finder'
set theFilePath to file 'My File.txt' of desktop
end tell
--> Result: document file 'My File.txt' of folder 'Desktop' of folder 'yourUserName' of folder 'Users' of startup disk of application 'Finder'
set theFilePath to theFilePath as alias
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
Converting from a string or alias to a POSIX path can’t be done through coercion. Instead, you must access the
POSIX path
property of the path to convert, as shown in Listing 15-18.APPLESCRIPT
Listing 15-18AppleScript: Converting an alias to a POSIX path stringset theFilePath to choose file
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
set theFilePath to POSIX path of theFilePath
--> Result: '/Users/yourUserName/Desktop/My File.txt'
Using Conversion Handlers
Running paths through a conversion handler is a good way to ensure the format you expect.
Converting a Path to an Aliases
The handler in Listing 15-19 converts strings,
path
objects, POSIX file
objects, Finder paths, and System Events paths to alias
format.APPLESCRIPT
Listing 15-19AppleScript: Handler that converts a path to an AppleScript aliason convertPathToAlias(thePath)
tell application 'System Events'
try
return (path of disk item (thePath as string)) as alias
on error
return (path of disk item (path of thePath) as string) as alias
end try
end tell
end convertPathToAlias
Listing 15-19 shows how to call the handler in Listing 15-19 to convert a POSIX-style path string to an alias.
APPLESCRIPT
Listing 15-20AppleScript: Calling a handler to convert a path to an AppleScript aliasset thePath to '/Users/yourUserName/Desktop/My File.txt'
set thePath to convertPathToAlias(thePath)
--> Result: alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
Converting a Path to a String
The handler in Listing 15-21 converts a path to string format.
APPLESCRIPT
Listing 15-21AppleScript: Handler that converts a path to an a stringon convertPathToString(thePath)
tell application 'System Events'
try
return path of disk item (thePath as string)
on error
return path of thePath
end try
end tell
end convertPathToString
Listing 15-22 shows how to call the handler in Listing 15-21 to convert an alias to a path string.
APPLESCRIPT
Listing 15-22AppleScript: Calling a handler to convert an AppleScript alias to a path stringset thePath to alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
set thePath to convertPathToString(thePath)
--> Result: 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
Converting a Path to a POSIX Path String
The handler in Listing 15-23 converts a path to POSIX path string format.
APPLESCRIPT
Listing 15-23AppleScript: Handler that converts a path to an a POSIX path stringon convertPathToPOSIXString(thePath)
tell application 'System Events'
try
set thePath to path of disk item (thePath as string)
on error
set thePath to path of thePath
end try
end tell
return POSIX path of thePath
end convertPathToPOSIXString
Listing 15-24 shows how to call the handler in Listing 15-23 to convert an alias to a path string.
APPLESCRIPT
Listing 15-24AppleScript: Calling a handler to convert an AppleScript alias to a POSIX path stringset thePath to alias 'Macintosh HD:Users:yourUserName:Desktop:My File.txt'
set thePath to convertPathToPOSIXString(thePath)
--> Result: '/Users/yourUserName/Desktop/My File.txt'
Modifying this control will update this page automatically
Preview User Guide
You can open PDFs and images in Preview, change how documents are shown in the Preview window, and get information about the files.
Open PDFs and images
You can double-click a PDF or image file to open it by default in Preview. You can also open Preview and select the files you want to view.
Ptsx File View App For Mac Download
- In the Preview app on your Mac, choose File > Open.
- Locate and select the file or files you want to open, then click Open.Tip: To open a file you’ve worked on recently, choose File > Open Recent.
To open a document in iCloud Drive, click iCloud Drive in the Finder sidebar, then double-click the PDF to open it. See Use iCloud Drive to store documents.
From the Desktop, you can also select a file or files, then choose File > Open With > Preview.
If you open multiple files at the same time, you can set them to open in the same Preview window or open in tabs.
View PDFs or images
When you open a PDF with multiple pages, you can view thumbnails of all the pages in the sidebar.
- In the Preview app on your Mac, open a PDF or image that you want to view.
- Do any of the following:
- Show thumbnails: Choose View > Thumbnails or View > Contact Sheet.
- Show a document’s table of contents (if it has one): Choose View > Table of Contents.
- Close the sidebar: Choose View > Hide Sidebar.
- Show pages in a continuous scroll: Choose View > Continuous Scroll.
- Show one page at a time: Choose View > Single Page.
- Show two pages side by side: Choose View > Two Pages.
- Scroll pages: Swipe up or down on the trackpad using two fingers.
- Go to a specific page: Click a thumbnail, or choose Go > Go to Page.
- Go to the previous or next page: Click the Previous button or the Next button in the Preview toolbar. (If you don’t see the buttons, choose View > Customize Toolbar, then add them.) If your Mac has a Force Touch trackpad, you can accelerate through the previous or next pages by pressing and holding the button, then adding pressure; the more firmly you press, the faster you move through the pages.
Change how thumbnails are shown
If a window sidebar contains multiple PDFs, you may have trouble finding a particular document. You can collapse a PDF’s page thumbnails so you see only the PDF’s filename.
- In the Preview app on your Mac, open a PDF or image that you want to view.
- Do any of the following:
- View thumbnails: Choose View > Thumbnails or View > Contact Sheet.
- Sort thumbnails: Control-click a thumbnail, then choose an item from the Sort By submenu in the shortcut menu.The thumbnails are sorted by file. You can’t sort PDF page thumbnails within a PDF.
- Change the size of the thumbnails: Choose View > Thumbnails, then drag the sidebar’s separator to the left or right to change the width of the sidebar.
- Collapse or expand PDF thumbnails: Click the arrow next to the PDF’s filename in the sidebar.
View information about PDFs or images
You can use the Inspector to view information about a document or image, such as file size, the author’s name, and the image resolution.
Ptsx File View App For Mac Computer
- In the Preview app on your Mac, open a PDF or image that you want to view.
- Choose Tools > Show Inspector, then do any of the following:
- Get general file information: Click the General Info Inspector button .
- View keywords: Click the Keywords button . See Assign keywords to a PDF or image.
- View a list of annotations: Click the Annotations Inspector button . To display an annotation, double-click it. See Annotate a PDF or Annotate an image.
- View encryption and permission information in a PDF: Click the Encryption button . See Password-protect a PDF.
- View cropping information in a PDF: When using a selection tool, you can click the Crop Inspector button to view the dimensions of the content you are selecting, and choose a unit of measurement that’s displayed in the Crop Inspector window.
- View information about an image: Click the More Info Inspector button . See See where a photo was taken
Zoom in or out
- In the Preview app on your Mac, open a PDF or image that you want to view.
- Do any of the following:
- Zoom in or out: Choose View > Zoom In or View > Zoom Out. On some trackpads, you can pinch your thumb and index finger closed or open on the trackpad. See Use trackpad and mouse gestures.
- View the original size of an image or page: Choose View > Actual Size.
- Zoom to a particular section of an image or PDF: Choose Tools > Rectangular Selection, select the section, then choose View > Zoom to Selection.
- View a page at a specific percentage of its original size: Type a percentage in the Scale field in the toolbar.If you don’t see the Scale field, choose View > Customize Toolbar, then drag the Scale field to the toolbar.
- Magnify an area in an image or PDF: Choose Tools > Show Magnifier, then move the pointer over the area you want to magnify. To stop magnifying, choose Tools > Hide Magnifier or press the Esc key.
Ptsx File View App For Mac Windows 10
See alsoDisplay several files in one Preview window on MacFind text in PDFs in Preview on MacBookmark PDF pages in Preview on MacKeyboard shortcuts in Preview on MacChange a window’s background color in Preview on Mac